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
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
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);
}
}