Hi Experts,

i captured an image by android G1, now trying to display it as
ImageView but it gives me memory allocation exception.

Uri image= Uri.parse(imageFile);
imageicon.setImageURI(image);


/////////////////

<ImageView
                        android:id="@+id/imageicon"

                       android:adjustViewBounds="true"
            android:maxWidth="291dip"
            android:maxHeight="55dip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:paddingTop="10dip"
            />

the default image resolution of G1 camera is 2048 * 1536

i also tried to compress image on selection but still same exception.
////////////////////////////
onActivityResult
//////////////////////////

OutputStream outstream;
Bitmap bitmap = Media.getBitmap(getContentResolver(), selectedImage);

outstream = getContentResolver().openOutputStream(Uri.parse
(imageFile));
                                                                                
                bitmap.compress(Bitmap.CompressFormat.JPEG, 70,
outstream);
outstream.close();




any solution please?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to