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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:03:35+00:00 2026-05-23T03:03:35+00:00

I am parsing images from XML and show it in My Android Application. my

  • 0

I am parsing images from XML and show it in My Android Application. my problem is when parse more than 20 image the following error occur…

06-09 14:28:37.710: ERROR/AndroidRuntime(490): java.lang.RuntimeException: An error occured while executing doInBackground()
06-09 14:28:37.710: ERROR/AndroidRuntime(490):     at android.os.AsyncTask$3.done(AsyncTask.java:200)
06-09 14:28:37.710: ERROR/AndroidRuntime(490):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
06-09 14:28:37.710: ERROR/AndroidRuntime(490):     at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
06-09 14:28:37.710: ERROR/AndroidRuntime(490):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
06-09 14:28:37.710: ERROR/AndroidRuntime(490):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-09 14:28:37.710: ERROR/AndroidRuntime(490):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
06-09 14:28:37.710: ERROR/AndroidRuntime(490):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
06-09 14:28:37.710: ERROR/AndroidRuntime(490):     at java.lang.Thread.run(Thread.java:1096)
06-09 14:28:37.710: ERROR/AndroidRuntime(490): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
06-09 14:28:37.710: ERROR/AndroidRuntime(490):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
06-09 14:28:37.710: ERROR/AndroidRuntime(490):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:459)
06-09 14:28:37.710: ERROR/AndroidRuntime(490):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)
06-09 14:28:37.710: ERROR/AndroidRuntime(490):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
06-09 14:28:37.710: ERROR/AndroidRuntime(490):     at android.graphics.drawable.Drawable.createFromStream(Drawable.java:657)
  • 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-23T03:03:36+00:00Added an answer on May 23, 2026 at 3:03 am

    I had the same problem once when thumbnailing images for a file editor I made. What you want to do is shrink the images before storing them to memory, and disposing of the source images from system memory once they have been read

    Here is the code I used for mine, it shrinks the images to 110×110, but you can set up your own algorithm to scale it (I believe there is actually already a function for that within the resizedbitmap class, but I havent used it)

    public void setImageFromFile(String filename) {
        ImageView fileImage = (ImageView)findViewById(R.id.file_image_holder);
        Bitmap icon = BitmapFactory.decodeFile(filename);
        int width = icon.getWidth();
        int height = icon.getHeight();
        int newWidth = 110;
        int newHeight = 110;
        float scaleWidth = ((float) newWidth) / width;
        float scaleHeight = ((float) newHeight) / height;
    
        Matrix bMatrix = new Matrix();
        bMatrix.postScale(scaleWidth, scaleHeight);
    
        Bitmap resizedBitmap = Bitmap.createBitmap(icon, 0, 0, width, height, bMatrix, true);
        BitmapDrawable bmd = new BitmapDrawable(resizedBitmap);
        fileImage.setImageDrawable(bmd);
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've the following problem: I'm parsing an XML File from Flickr API http://api.flickr.com/services/feeds/photos_public.gne?tags= with
I am parsing the public timeline xml from twitter and want to display images
Using simplexml_load_file(), if I'm parsing out XML and I get the following for image...
I'm looking A little help on parsing XML from the internet to an Android
I am developing an application and I am displaying images from URl using xml
I m reading the xml images from rss feed and parsing it in UITable
I'm parsing an xml file (that contains urls of images), taking the urls from
I have an error when parsing an xml document with sax parser in android.
I am displaying images from an URL using XML parsing and some images are
I get images from a URL using XML Parsing. I loaded the all images

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.