2014/08/20

How to show online image in android gallery app

Just found this function in a competitor's app XD

Sometimes , we need to allow the user be able to browse and zoomin an online image .
I can just show it in webview. (it's much more simple) . 
Or download the image in background and send an intent with the URI in local storage.

But the most convenient way is .... just request the gallery app to show the online image.

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("http://xxx.xxx/xxx.jpg") ,"image/*");
startActivity(intent);

The android gms gallery app  receive this intent and show it , but the one in emulator doesn't.

沒有留言: