Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9018577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:33:43+00:00 2026-06-16T04:33:43+00:00

I have a big problem with the function to choose a picture in the

  • 0

I have a big problem with the function to choose a picture in the gallery’s phone !
I chose the photo, I get the URI and when a read the stream in the “onActivityResult” for put the stream in a bitmap I have a “outoffmemoryerror”.

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
       Uri uri = data.getData();
       InputStream is = getContentResolver().openInputStream(mSelectedUri);
       Bitmap bitmap = BitmapFactory.decodeStream(is);
}

I have tried other code but I have the same problem.
Well, depends the picture !

I have find this :
http://developer.android.com/training/displaying-bitmaps/index.html
And
http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

with this : “To avoid java.lang.OutOfMemory exceptions, check the dimensions of a bitmap before decoding it, unless you absolutely trust the source to provide you with predictably sized image data that comfortably fits within the available memory.”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:33:45+00:00Added an answer on June 16, 2026 at 4:33 am

    Sometimes images are to big for bitmaps, so a way to get Your bitmap is to scale down the image. At this site is a good example and it worked very good for me

    http://twigstechtips.blogspot.com/2011/10/android-resize-bitmap-image-while.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a big problem. I use excel auto filter function, at the end
i have a big problem to bind this method: [Bindable(event=LOCALE_CHANGED_EVENT_TYPE)] public static function localeString(pathInLocale:String):String
i have big problem with explanation code under, meanwhile i made two loops function
I have big problem when I am trying to deploy my app over clickonce.
I'm using editor from Kendo UI, so I have big problem. I don't know
I have a big problem that a recursive treeview doesn't update any childs if
I have a big problem with my app as it crashes often but never
I have a big problem. I had a configuration which worked properly till today.
I have a big problem that is I have implemented a scheduler in my
I have a big problem. I want to extract text from html table that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.