hi all,
im a new developer here so...
i am trying to change an imagview to a picture from the phones sd card. as
simple as that.
i managed to get to the phones gallery and select a picture. but i dont
seem to manage to retrive the picture and change the current imagview to
the new one.
thats what im doing to get to the gallery:
public void onClick(View v)
{
Intent intent = new Intent(Intent.ACTION_PICK,
MediaStore.Images.Media.INTERNAL_CONTENT_URI);
startActivityForResult(intent, 0);
}
retriving the image:
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);
}
when i press on a picture in the gallery it crushes.... the logcat says:
Failure delivering result ResultInfo{who=null, request=0, result=-1,
data=Intent { dat=content://media/external/images/media/2 }} to activity
{shtainberg.royi/shtainberg.royi.edit}: java.lang.NullPointerException
thak you all!! you are great.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en