In short, I'm trying to select an image from a phone gallery to display as a bitmap to be played with (get average RGB) in another activity.
First thing, I've come across a couple topics dealing with URI to Bitmap conversion. A lot of them have suggestions like (from: Retrieve bitmap from uri):
Uri imageUri = intent.getData();
Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(),imageUri);
Imageview my_img_view = (Imageview ) findViewById (R.id.my_img_view);
my_img_view.setImageBitmap(bitmap);
The Bitmap line is the important line. Whenever I run my Android app on my simulator, the app crashes (debugger in Eclipse confirms in happens on the URI --> Bitmap conversion line), and if I put the conversion in different activities (it is Bundled), then it still crashes on the Uri -> Bitmap conversion line.
I'm not sure why this is. I've tried making my intent both "EXTERNAL_CONTENT_URI" and "INTERNAL_CONTENT_URI" on the initial intent, and either choice doesn't matter. I'm going to keep looking for potential solutions to my problem, but I'm short on time right now and I feel it would be helpful if I had some advice from outside sources.
Anyone know why it always crashes on that line, or if there are any possible solutions to my problem? Thanks.