I am new at this :) I am trying to load a picture from the sdcard into an ImageView in this way:
b_picture.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_PICK,
MediaStore.Images.Media.INTERNAL_CONTENT_URI);
startActivityForResult(intent, 0);
}
});
Here I am trying to retrive the picture and change the ImageView:
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Bitmap bm = (Bitmap) data.getExtras().get("data");
iv_picture.setImageBitmap(bm);
}
And I get this from the logcat:
Failure delivering result ResultInfo {who=null, request=0, result=-1,
data=Intent { dat=content://media/external/images/media/2
I can't solve this problem. Can you help me? Thanks.