【发布时间】:2011-04-13 05:07:58
【问题描述】:
我正在尝试创建仅在 sdcard 上打开文件的程序。我尝试打开 mp3、mp4 和 apk - 下面的代码总是意外崩溃。
String _path = "file:///sdcard/1.apk";
Uri outputFileUri = Uri.parse(_path);
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
市场链接也会崩溃。但是当我设置 _path="http://google.com" - 浏览器正常打开。我怎样才能使这段代码工作?
【问题讨论】:
标签: android eclipse android-intent