I've a problem on ImageView. I am using an ImageView to show an Image
captured from camera or selected from Media.INTERNAL_CONTENT_URI;
When the result come back from preview camera Activity or from
Intent.ACTION_PICK Activity, the ImageView show the image and work
good. The second or third time that I set the ImageView, crash the
activity. The problem is on img.setImageURI(uri);
Any Idea ?
code:
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
if (requestCode == GET_IMAGE_FROM_CAMERA || requestCode ==
GET_IMAGE_FROM_FOLDER) {
// This is a standard resultCode that is sent back if
the
// activity doesn't supply an explicit result. It
will also
// be returned if the activity failed to launch.
if (resultCode != RESULT_CANCELED) {
if (data != null) {
try{
ImageView img= (ImageView) findViewById
(R.id.imgThumb);
Uri uri = data.getData();
//Toast.makeText(this, uri.toString(),
Toast.LENGTH_SHORT).show();
img.setImageURI(uri);
}
catch (Exception e) {
}
}
}
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---