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

  • Home
  • SEARCH
  • 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 3310326
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:44:48+00:00 2026-05-17T21:44:48+00:00

In my Android App I have a listview containing 30 rows, and each row

  • 0

In my Android App I have a listview containing 30 rows, and each row consists of several textviews of which one is spannable and sometimes contains a lot of formatted text and images.

Those images are loaded from the web asynchroneously: A placeholder is displayed until the image has been downloaded is then replaced by the image.

Unfortunately, the rows of the listview are loaded when I scroll over them. This makes the whole thing very slow. Also, those images are loaded from the web again and again, whenever I scroll over the row.

How can I turn it off, that the ListView rows are loaded when I scroll over them? They should be loaded once when I start the activity and never again.

Best regards and thanks in advance,
Jan Oliver

  • 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-17T21:44:49+00:00Added an answer on May 17, 2026 at 9:44 pm

    When you do a lazy-loading ListView, is because you want to speed it up your app. Turn it off is not the best solution. So, what you can do is implementing a basic cache system in order to avoid downloading and setting the ImageView again and again.

    The easiest way to do so is implementing a HashMap with URLs as keys and Bitmaps as values. Something like this:

    Map cache = new HashMap();
    // then, on your lazy loader
    Bitmap image = cache.get(urlOfTheImage);
    if( image == null ){
        // download and decode the image as normal,
        // then assign the decoded bitmap to
        // the 'image' variable
        cache.put(image);
    }
    imageView.setImageBitmap(image);
    

    If those images will be the same always, meaning that each time you open the app the same images will be downloaded, then you better save those images in the filesystem and use them from there.

    On the other hand, if the images tend to change, you could implement some interesting stuff: use SoftReferences. There’s an explanation in this video. This can also be used if you are loading images from the filesystem.

    Edit

    With regards to your comment, I highly recommend you watching the video I posted. It’s one hour long, but it really worths the effort. When using an adapter, checking if the convertView is null is just a simple way to improve performance, though there are some other techniques that will improve your app even more. Also, if you had have problems while using that trick, is because you are probably implementing it the wrong way. Remember: even if you don’t re-inflate the views, you do have to set the value of each one of the children views, otherwise you will experience some problems.

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

Sidebar

Related Questions

I have two threads in an Android application, one is the view thread, and
I'm building an Android app and I want to copy the text value of
I'm building a mobile web app targeting Android users. I need to know what
I'm doing some Android development, and I much prefer Visual Studio, but I'll have
In Android, when layout out widgets, what's the difference between fill_parent ( match_parent in
I understand the Android OS is based on Linux. Does that mean the G1
In my Android application, when I rotate the device (slide out the keyboard) then
Has anyone managed to use ItemizedOverlays in Android Beta 0.9? I can't get it
I've been working on the Android SDK platform, and it is a little unclear
Now that the G1 with Google's Android OS is now available (soon), will the

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.