I am trying to create program that simply opens file on sdcard. I tried opening mp3, mp4, and apk – the code bellow always crashes unexpectedly.
String _path = "file:///sdcard/1.apk";
Uri outputFileUri = Uri.parse(_path);
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
Market links also crashes. But when I set _path=”http://google.com” – browser opens normally. How can I make this code work?
If you’re trying to install the apk, you need to use the following:
If you’re trying to launch the app (after installing), then:
If you’re trying to launch a player to play the mp3 file:
Hope that helps.