I want to have an image open from a URL to an intent, most likely the browser or maybe a picture previewer like the one built into twidroyd.
Intent intent = new Intent();
Uri uri = Uri.parse("http://nssdc.gsfc.nasa.gov/image/planetary/earth/gal_new-zealand.jpg");
intent.setDataAndType(uri, "image/*");
intent.setAction(android.content.Intent.ACTION_GET_CONTENT);
startActivity(intent);
However when I try, I get the following exception:
ERROR/AndroidRuntime(232): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.GET_CONTENT dat=http://nssdc.gsfc.nasa.gov/image/planetary/earth/gal_new-zealand.jpg typ=image/* }
I've gotten plain URLs to open to the browser. I just can't figure out what action or category to specify, I've tried:
intent.addCategory("CATEGORY_BROWSABLE");
// and
intent.addCategory("CATEGORY_OPENABLE");
It also doesn't work if I set the action as:
android.content.Intent.ACTION_VIEW
Any Ideas?