我的应用程序具有浏览手机和SD卡上的文件并使用其他应用程序打开它们的功能.我想要一个解决方案,我不必指定MimeType,可以使用任何类型的文件.
这是我的代码:
Intent myIntent = new Intent(Intent.ACTION_VIEW);
myIntent.setData(Uri.fromFile(item));
startActivity(myIntent);
Run Code Online (Sandbox Code Playgroud)
但是,我收到以下错误:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.PICK dat=file:///sdcard/dropbox/test.pdf }
Run Code Online (Sandbox Code Playgroud) android ×1