Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/211.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 从通知栏打开目录_Java_Android_Android Intent_Notifications - Fatal编程技术网

Java 从通知栏打开目录

Java 从通知栏打开目录,java,android,android-intent,notifications,Java,Android,Android Intent,Notifications,我在后台从Url下载一个文件,并在通知中显示过程,下载的文件被存储到下载文件夹中,当用户点击通知栏时,我想打开下载文件夹(目录),我怎么做??这是我尝试过的,但它没有做任何事情,甚至在logcat中没有错误: DownloadFolder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); Intent intent = new Intent(); intent.setAction(

我在后台从Url下载一个文件,并在通知中显示过程,下载的文件被存储到下载文件夹中,当用户点击通知栏时,我想打开下载文件夹(目录),我怎么做??这是我尝试过的,但它没有做任何事情,甚至在logcat中没有错误:

DownloadFolder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);

Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(DownloadFolder), "file/*");
PendingIntent contentIntent = PendingIntent.getActivity(context, id, intent,
        PendingIntent.FLAG_UPDATE_CURRENT);
下载文件夹是android下载目录的路径,我不知道我做错了什么,因为我不知道,任何指导都会对我很有帮助


谢谢

尝试此意图操作:
intent.setAction(intent.action\u GET\u CONTENT)

文件夹打开,但单击该文件,它不会打开。有什么解决办法吗?