我正在使用下载管理器从网址下载文件。并且文件被成功下载。下载管理器进度在通知区域中不可见
问题
文件默默地下载,通知区域中的任何通知。
下载管理器在我的设备上运行android 6.0时显示通知(带进度条)。在我将设备更新到android 7.0后,下载管理器在通知区域上不显示任何通知。
这里是我的代码
Uri uri = Uri.parse("file://" + destination);
url = "http:....."; //Valid File URL
//Set up download manager request
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
request.setDescription("Downloading " + file_name);
request.setTitle("My Downloader");
request.setDestinationUri(uri); //URI is valid
//Start the download
DownloadManager manager = (DownloadManager) getContext()
.getSystemService(Context.DOWNLOAD_SERVICE);
还加入request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE);
是没有帮助我的情况。
构建信息
这里是我的摇篮构建infformation。
minSdkVersion 22
targetSdkVersion 23
compileSdkVersion 25
buildToolsVersion "25.0.2"