我希望我的应用程序通过单击按钮打开“文件”>“下载”。以下代码不起作用。它所要做的就是重新启动我的应用程序。我究竟做错了什么?
Intent launchDownloadsFolder = new Intent(Intent.ACTION_VIEW);
Uri getDLFolder = Uri.parse("file://" +
DownloadPromptPopUp.downloadDirectory);
launchDownloadsFolder.setDataAndType(getDLFolder, "videos/*");
launchDownloadsFolder.getData();
startActivity(launchDownloadsFolder);
对的,这是可能的。您可以尝试下面的代码来完成工作。
startActivity(new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS));
希望这会帮助你。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句