1

How can I open a image with another app like the gallery ?

so which intent do I have to call ?

Intent in=new Intent("intent?");
         startActivity(in);
Alexander Fuchs
  • 1,358
  • 3
  • 19
  • 36
  • possible duplicate of [Open an image in Android's built-in Gallery app programmatically](http://stackoverflow.com/questions/2169649/open-an-image-in-androids-built-in-gallery-app-programmatically) – MByD Feb 17 '12 at 13:01
  • Check out [this][1] [1]: http://stackoverflow.com/questions/2169649/open-an-image-in-androids-built-in-gallery-app-programmatically – Raghu Nagaraju Feb 17 '12 at 13:36
  • Chekc out [this][1] [1]: http://stackoverflow.com/questions/2169649/open-an-image-in-androids-built-in-gallery-app-programmatically – Raghu Nagaraju Feb 17 '12 at 13:37
  • I want to show a picture not to select one – Alexander Fuchs Feb 17 '12 at 14:19

2 Answers2

2

This will create an Intent for Android to show a image/png.

Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(path)), "image/png");
startActivity(intent);

Just make sure the file is in a place visible to all, not in your private sandbox. Saving it to sdcard in the data folder is common eg. /sdcard/data/appname/filename.png

knaak
  • 1,293
  • 1
  • 12
  • 18
0

use this

       intent.setData(android.Provider.MediaStore.Images.Media.Data);
DineshKumar
  • 1,641
  • 15
  • 13