Handle Intent VIEW typ=audio/mpeg



所以我的想法是使用设备上已经预装的应用程序打开一个文件。这是我的代码

Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(fileUri);
intent.setType(mimeType);
startActivity(intent);

我的错误信息是

08-25 12:50:32.900: E/AndroidRuntime(19555): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW typ=audio/mpeg }

有什么办法吗?我读过关于意向过滤器的文章,但这里的人告诉我,如果我要使用其他应用程序打开我的文件,那么我不需要指定任何过滤器,这是真的吗?

p.S.由于某种原因,它可以很好地打开PDF文件,以及JPG和TXT

谢谢Dennis xx

有什么办法吗?

在您的手机上安装一个具有处理此MIME类型的活动的应用程序。并非所有可能的MIME类型都会由设备上已有的应用程序处理。

如果您认为设备上的某个应用程序应该能够处理此问题,请使用AppXplore检查其清单,并查看哪里出了问题(例如,fileUri使用了不受支持的方案)。

请在此处查看支持的媒体格式。确保您正在使用其中一个。

最新更新