Tuesday, 20 August 2013

Opening gallery as app programmatically

Opening gallery as app programmatically

I want to open gallery when user presses a button. The code I use is this:
Intent resimGaleri = new Intent();
resimGaleri.setType("image/*");
resimGaleri.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Main.this.startActivity(resimGaleri);
However, in this code, when user presses the button to open gallery,
Android asks 'Complete action using', but I want it to open gallery
directly without asking. I can do that with the following code:
startActivity(new Intent("com.android.gallery3d"));
But I'm not sure if all devices use 'com.android.gallery3d' or not. Is it
possible or is there any other way to do that?

No comments:

Post a Comment