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 851583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:27:06+00:00 2026-05-15T07:27:06+00:00

I was trying to make an app which also had the facility to let

  • 0

I was trying to make an app which also had the facility to let user select wallpaper he would like to set. I have managed this by calling the Gallery Intent. Once the user selects a specific image, the data path of the image is returned to me which then i preview to the user by setting the image onto an imageview.

The problem crops up when the image size (and/or resolution) is greater than what android expects. This results in failure of my module.

And as if this was not enough, wen the user tries to select some other wallpaper(and in my test case the “other” wallpaper was also of size >700kb) then the app crashes with the “OutOfMemoryException”…

Helppp me here guys!!!

For Gallery Intent i use:

Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),SELECT_IMAGE);

For setting the wallpaper i use:

InputStream is = getContentResolver().openInputStream(Uri.parse(uri_returned_from_intent)); 
Bitmap bgImage = BitmapFactory.decodeStream(is);//OutOfMemory error thrown here
setWallpaper(bgImage);

So i have 2 problems to deal with:

  1. How to crop the image before setting it as wallpaper…
  2. Cant understand y OutOfMemoryException is thrown, coz none of my image sizes exceed even 1mb… and i guess the VM budget in case Of N1 is 24Mb if m not mistaken…
  • 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-05-15T07:27:07+00:00Added an answer on May 15, 2026 at 7:27 am

    You should decode with inSampleSize option to reduce memory consumption.

    • Android: Strange out of memory issue while loading an image to a Bitmap object (stackoverflow)

    Another option inJustDecodeBounds can help you to find correct inSampleSize value

    • How to get bitmap infomation before decode an image file? (Google Groups)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make logging for my rails app and have some dilemmas over
I'm trying to make a like button for my iframe facebook app. With an
Trying to make a make generic select control that I can dynamically add elements
I'm trying to build a proof of concept Csla 3.7/Silverlight 3 app and have
I am in the process of trying to make an app that has most
I have an issue when I'm trying to make my image or label visible
I am trying to learn rails from zero programming experience and have an app
Trying to make a MySQL-based application support MS SQL, I ran into the following
Trying to make a generic PL/SQL procedure to export data in specific XML format,
Trying to make a web service call to an HTTPS endpoint in my Silverlight

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.