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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:42:17+00:00 2026-06-05T13:42:17+00:00

I am showing image into listview from webservice suppose I am testing application 10

  • 0

I am showing image into listview from webservice suppose I am testing application 10 times
then 6 time this exception comes please anyone help me.
I am calling web service using AsyncTask.

06-12 14:49:53.132: E/dalvikvm-heap(3071): Out of memory on a 1920016-byte allocation.
 06-12 14:49:53.160: E/AndroidRuntime(3071): FATAL EXCEPTION: AsyncTask #3
 06-12 14:49:53.160: E/AndroidRuntime(3071): java.lang.RuntimeException: An error  occured while executing doInBackground()
  06-12 14:49:53.160: E/AndroidRuntime(3071):   at android.os.AsyncTask$3.done(AsyncTask.java:278)
 06-12 14:49:53.160: E/AndroidRuntime(3071):    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
 06-12 14:49:53.160: E/AndroidRuntime(3071):    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
 06-12 14:49:53.160: E/AndroidRuntime(3071):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
 06-12 14:49:53.160: E/AndroidRuntime(3071):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
 06-12 14:49:53.160: E/AndroidRuntime(3071):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
 06-12 14:49:53.160: E/AndroidRuntime(3071):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-12 14:49:53.160: E/AndroidRuntime(3071):     at java.lang.Thread.run(Thread.java:856)
06-12 14:49:53.160: E/AndroidRuntime(3071): Caused by: java.lang.OutOfMemoryError
 06-12 14:49:53.160: E/AndroidRuntime(3071):    at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
 06-12 14:49:53.160: E/AndroidRuntime(3071):    at an droid.graphics.BitmapFactory.decodeStream(BitmapFactory.java:493)
06-12 14:49:53.160: E/AndroidRuntime(3071):     at com.rentfaster.utilities.ImageLoader.decodeFile(ImageLoader.java:142)
06-12 14:49:53.160: E/AndroidRuntime(3071):     at com.rentfaster.utilities.ImageLoader.getBitmap(ImageLoader.java:78)
 06-12 14:49:53.160: E/AndroidRuntime(3071):    at com.rentfaster.handler.DetailPhotoHandler.imagefecher(DetailPhotoHandler.java:211)
  06-12 14:49:53.160: E/AndroidRuntime(3071):   at com.rentfaster.handler.DetailPhotoHandler.characters(DetailPhotoHandler.java:153)
 06-12 14:49:53.160: E/AndroidRuntime(3071):    at org.apache.harmony.xml.ExpatParser.text(ExpatParser.java:163)
 06-12 14:49:53.160: E/AndroidRuntime(3071):    at org.apache.harmony.xml.ExpatParser.appendBytes(Native Method)
 06-12 14:49:53.160: E/AndroidRuntime(3071):    at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:513)
  06-12 14:49:53.160: E/AndroidRuntime(3071):   at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:474)
  06-12 14:49:53.160: E/AndroidRuntime(3071):   at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:321)
  06-12 14:49:53.160: E/AndroidRuntime(3071):   at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:279)
 06-12 14:49:53.160: E/AndroidRuntime(3071):    at com.rentfaster.home.PropertyDetail$Photostask.doInBackground(PropertyDetail.java:1174)
  06-12 14:49:53.160: E/AndroidRuntime(3071):   at com.rentfaster.home.PropertyDetail$Photostask.doInBackground(PropertyDetail.java:1)
06-12 14:49:53.160: E/AndroidRuntime(3071):     at android.os.AsyncTask$2.call(AsyncTask.java:264)
06-12 14:49:53.160: E/AndroidRuntime(3071):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-12 14:49:53.160: E/AndroidRuntime(3071):     ... 4 more
06-12 14:50:02.882: E/parse exception0(3258):  dont know why
06-12 14:50:02.882: E/XML Error(3258): java.net.MalformedURLException: Protocol not found: &area=53.447557,-113.460058,53.447557,-113.460058&max=100
06-12 14:50:02.921: E/MapActivity(3258): Couldn't get connection factory client

I am still facing Out of memory problem ,I am using this code please help me

//decodes image and scales it to reduce memory consumption
    private static Bitmap decodeFile(File f){
       try {
        //decode image size
        BitmapFactory.Options o = new BitmapFactory.Options();
        o.inSampleSize = 2;
        o.inJustDecodeBounds = true;
        BitmapFactory.decodeStream(new FileInputStream(f),null,o);

        //Find the correct scale value. It should be the power of 2.
        final int REQUIRED_SIZE=70;
        int width_tmp=o.outWidth, height_tmp=o.outHeight;
        int scale=1;
        while(true){
            if(width_tmp/2<REQUIRED_SIZE || height_tmp/2<REQUIRED_SIZE)
                break;
            width_tmp/=2;
            height_tmp/=2;
            scale*=2;
        }

        //decode with inSampleSize
        BitmapFactory.Options o2 = new BitmapFactory.Options();

        o2.inSampleSize=2;
        return BitmapFactory.decodeStream(new FileInputStream(f), null, null);
    } catch (FileNotFoundException e) {}
    return null;
}
  • 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-05T13:42:18+00:00Added an answer on June 5, 2026 at 1:42 pm

    You ran out of memory while Creating bitmap coming from ,you need to reduce the size of bitmap using

     BitmapFactory.Options option = new BitmapFactory.Options();
        option.inSampleSize = 2;
    
    
    Bitmap bm = BitmapFactory.decodeFile(root.getPath() + "/" + imageName,
                                option);
                        imageView.setImageBitmap(bm);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to add image in an UIAlertView, like showing an image from
Please visit this link Click on first Image. Now is showing the Modal page
echo '<img src=data:image/jpg/png/jpeg;base64,' . base64_encode( $row['image'] ) . ' height=150 />'; This is showing
I am able to load a resource image, from drawable folder, into a bitmap
Please have a look at this image Grid Showing Pending Work http://softwaregenius.net/myimages/grid.png The image
I am loading an asp image into my site and its showing in the
How to crop an image coming from server into popup? I have image coming
I'm trying to implement 'lever' into my android game, here's image showing what do
I have a view where I am showing image and image name in a
I have a UIImageView showing a image that is larger than it's frame. It's

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.