Hi,

I get an OutOfMemoryError every time i change the screen orientation
and I am having a hard time finding the mistake...

The Activitie's view consists of an ImageView, two Buttons and a
Spinner. I don't have static variables and can't imagine where i could
leak a context.

Most of the times, the exception is thrown at setContentView
(R.layout.upload);
sometimes it goes fine until imgUpload.setImageURI(imageURI);

The images i am displaying are form the G1's camera, so about 500kb
and 2048x1536pixels

Here is some code:
-------------------------------------------------------------------------------------
        private ImageView imgUpload;
        private Spinner spnCollections;
        private Button btnEditMetadata;
        private Button btnUpload;
        private Uri imageURI;

        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.upload);

                // Get View References
                imgUpload = (ImageView) findViewById(R.id.imgUpload);
                spnCollections = (Spinner)findViewById(R.id.spnCollections);
                btnEditMetadata = (Button) findViewById(R.id.btnEditMetadata);
                btnUpload = (Button)findViewById(R.id.btnUpload);

                // Get Image from ACTION_SEND Intent
                Intent intent = getIntent();
                if (intent.getAction() != null && intent.getAction().equals
(Intent.ACTION_SEND)) {
                        Bundle extras = intent.getExtras();
                        imageURI = 
(Uri)extras.getParcelable(Intent.EXTRA_STREAM);
                        imgUpload.setImageURI(imageURI);
                }
...
-------------------------------------------------------------------------------------

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to