-1

I just want to start my Activity, retrieve some pictures already in the phone's gallery (without user interaction) and display one of them in my Activity. Is that possible?

Best regards, Mattias

Mattias
  • 587
  • 2
  • 6
  • 11
  • 1
    is this what you're looking for?: http://stackoverflow.com/questions/2169649/open-an-image-in-androids-built-in-gallery-app-programmatically – mfsiega Jun 13 '12 at 15:24

1 Answers1

0

Use this code to get gallery images

Intent photoPickerIntent = new Intent(Intent.ACTION_GET_CONTENT);
photoPickerIntent.setType("image/*");
startActivityForResult(photoPickerIntent, 1);

protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == RESULT_OK)
    {
        Uri chosenImageUri = data.getData();

        Bitmap mBitmap = null;
        mBitmap = Media.getBitmap(this.getContentResolver(), chosenImageUri);
        }
}
Manikandan
  • 2,463
  • 5
  • 51
  • 91