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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:05:18+00:00 2026-05-23T01:05:18+00:00

Hi i am getting the following exception while fetching the image from server. I

  • 0

Hi i am getting the following exception while fetching the image from server. I works for fetching 5-7 images after that got the following:

06-12 16:35:50.904:
WARN/AsyncTask(717):
java.lang.InterruptedException 06-12
16:35:50.904: WARN/AsyncTask(717):
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1254)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:219)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
java.util.concurrent.FutureTask.get(FutureTask.java:82)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
android.os.AsyncTask$3.done(AsyncTask.java:196)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
java.util.concurrent.FutureTask$Sync.innerCancel(FutureTask.java:293)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
java.util.concurrent.FutureTask.cancel(FutureTask.java:75)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
android.os.AsyncTask.cancel(AsyncTask.java:325)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
us.bnn.news.IncidentDetailsActivity$GetImages.doInBackground(IncidentDetailsActivity.java:1691)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
us.bnn.news.IncidentDetailsActivity$GetImages.doInBackground(IncidentDetailsActivity.java:1)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
android.os.AsyncTask$2.call(AsyncTask.java:185)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
06-12 16:35:50.904:
WARN/AsyncTask(717): at
java.lang.Thread.run(Thread.java:1096)

I an using this method:

public static Bitmap getLargeImage(String imgUrl)
    {
        Bitmap bitmap = null;               
        InputStream in = null;
        Log.v(TAG,"start fetchimg main images");
        try
        {             
            DefaultHttpClient mHttpClient = new DefaultHttpClient();

            HttpGet mHttpGet = new HttpGet(imgUrl);

            HttpResponse mHttpResponse = mHttpClient.execute(mHttpGet);

            if (mHttpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) 
            {
                HttpEntity entity = mHttpResponse.getEntity();           
                if ( entity != null) 
                {
                    in = entity.getContent();

                    BufferedInputStream bis = new BufferedInputStream(in, 8190);

                    ByteArrayBuffer baf = new ByteArrayBuffer(50);
                    int current = 0;
                    while ((current = bis.read()) != -1) {
                        baf.append((byte)current);
                    }
                    byte[] imageData = baf.toByteArray();
                    BitmapFactory.decodeByteArray(imageData, 0, imageData.length);
                    if(in != null)
                        in.close();
                } 
            }                     
        }
        catch (Exception ex)
        {
            Log.v("Error Fetching images from url",ex.getMessage());          
        }
        return bitmap;
    }
  • 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-23T01:05:19+00:00Added an answer on May 23, 2026 at 1:05 am

    Do you receive images in different threads? If yes, which class do you use to download the images? Standard HttpClient is not thread-safe, you should use ThreadSafeClientConnManager to get thread-safe one.

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

Sidebar

Related Questions

I'm getting the following exception while redrawing my DataGridView control: Unhandled exception : Odwołanie
I am getting the following exception when deploying my application to Jboss 5.0.1 :
I am getting following error while exporting data to excel sheet ERROR: Message :
Here's some code that throws an exception because of some of the memory management
Am creating a table with sql server 2008 and using linq to sql. Am
The code I'm writing copies data from one table to another. It is possible
This is XML <?xml version=1.0 encoding=UTF-8?> <person> <fullname>Guilherme</fullname> <age>10</age> <address>address,address,address,address,</address> </person> <person> <fullname>Guilherme</fullname> <age>10</age>
Previously I was not using an interface for my generic repository. When I extracted
Previously I was not using an interface for my generic repository. When I extracted
I followed the steps here to make my existing WCF service (already working fine

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.