I am running context.startActivity(intent);
and my intent looks like this:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.setDataAndType(Uri.parse(uri), mimeType);
uri at that point is a String http://remote.server.path/photo-12212324324.jpg
and mimeType is image/jpeg
Here's an example of the exception.
12-07 20:48:55.934: I/ActivityManager(633): START u0 {act=android.intent.action.VIEW dat=http: typ=image/jpeg flg=0x1} from pid 1414
12-07 20:48:55.964: W/dalvikvm(1414): threadid=1: thread exiting with uncaught exception (group=0x40cb5ba0)
12-07 20:48:56.034: E/AndroidRuntime(1414): FATAL EXCEPTION: main
12-07 20:48:56.034: E/AndroidRuntime(1414): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=http: typ=image/jpeg flg=0x1 }
12-07 20:48:56.034: E/AndroidRuntime(1414): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1760)
12-07 20:48:56.034: E/AndroidRuntime(1414): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1555)
12-07 20:48:56.034: E/AndroidRuntime(1414): at android.app.Activity.startActivityForResult(Activity.java:3431)
This happens on at least two devices in the field, one of which is Samsung Galaxy S5, and therefore, I doubt that there's no app to handle the intent as the user will have at least Samsung Gallery app installed.. I know I can just handle the exception and show an error, but that's not really a fix..