Pick an image from the Gallery
Posted
by Steve Jones
on Stack Overflow
See other posts from Stack Overflow
or by Steve Jones
Published on 2010-05-07T20:40:30Z
Indexed on
2010/05/07
22:08 UTC
Read the original article
Hit count: 152
android
|android-sdk
I have seen a lot of posts about this, and it seems like the code below should work. I have created an SD Card image and added it to the emulator (and that works fine).
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
//intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent, 1);
It does launch and allow selection of images, but when I click on an image, everything exits and the emulator returns to the home screen, not the back to my app. My onActivityResult is never called either.
What am I missing?
© Stack Overflow or respective owner