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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:10:22+00:00 2026-06-13T12:10:22+00:00

I came across an early post regarding lazy loading image in listview, and tried

  • 0

I came across an early post regarding lazy loading image in listview, and tried to experiment with a posted answer(the 1st answer with a green check). Lazy load of images in ListView.

However i am still confused with 2 things:

  1. what is the definition of ‘lazy loading’ in a list view?
    From what i thought before on UI perspective, if the item images are stored locally in phone, ‘lazy loading’ means you do not start to load the list item until user can see or scroll to that item (when items are more than 1 screen). But here, with image stored in remote url, it seems to means that ‘an image is loaded from url 1st time, afterwards will load from local cache’, is this the idea of ‘lazy’ here?

  2. in the 1st answer in the post, the DrawableManager.fetchDrawable() method can not be used in the getView() method of listview adapter directly, it seems. I am getting below error msg from ddms log (see below), and it’s saying sth about ‘NetworkOnMainThreadException‘. So how can DrawableManager.fetchDrawable() be use in listview here? is it true that only a thread based implementation like DrawableManager.fetchDrawableOnThread() can be used in a list adapter’s getView() function?

Could you share some thoughts on these question? Appreciate it.

10-25 04:52:43.628: E/AndroidRuntime(2231): FATAL EXCEPTION: main
10-25 04:52:43.628: E/AndroidRuntime(2231): android.os.NetworkOnMainThreadException
10-25 04:52:43.628: E/AndroidRuntime(2231):     at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1084)
10-25 04:52:43.628: E/AndroidRuntime(2231):     at java.net.InetAddress.lookupHostByName(InetAddress.java:391)
10-25 04:52:43.628: E/AndroidRuntime(2231):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:242)
10-25 04:52:43.628: E/AndroidRuntime(2231):     at java.net.InetAddress.getAllByName(InetAddress.java:220)
10-25 04:52:43.628: E/AndroidRuntime(2231):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
10-25 04:52:43.628: E/AndroidRuntime(2231):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
10-25 04:52:43.628: E/AndroidRuntime(2231):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
10-25 04:52:43.628: E/AndroidRuntime(2231):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
10-25 04:52:43.628: E/AndroidRuntime(2231):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
10-25 04:52:43.628: E/AndroidRuntime(2231):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
10-25 04:52:43.628: E/AndroidRuntime(2231):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
10-25 04:52:43.628: E/AndroidRuntime(2231):     at com.example.fairfax.MainActivity$DrawableManager.fetch(MainActivity.java:230)
10-25 04:52:43.628: E/AndroidRuntime(2231):     at com.example.fairfax.MainActivity$DrawableManager.fetchDrawable(MainActivity.java:187)
10-25 04:52:43.628: E/AndroidRuntime(2231):     at com.example.fairfax.MainActivity$LazyAdapter.getView(MainActivity.java:162)
  • 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-13T12:10:22+00:00Added an answer on June 13, 2026 at 12:10 pm
    1. lazy loading in general means that the resource is not loaded until it is really needed. in your example that means exactly what you said: as soon as the list item is shown the first time, the images gets loaded from the URL. the next time it can be loaded from an internal cache. Be careful though with the cache to not use too much memory.
    2. Network access should never happen in the UI thread, otherwise the UI will freeze for the time it takes to load the resource. I don’t know anything about DrawableManager.fetchDrawableOnThread(), but I usually use an AsyncTaks for that. This helps to keep the UI responsive. Just google for “android async image loading” or something similar, you will find plenty of examples.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came across this strange looking declaration in some code early this morning (before
I just came across an answer on SO with a curious syntax: How do
Came across this post & it says referential integrity handled by the DB is
Came across this code: <?php require_once 'HTTP/Session/Container/DB.php'; $s = new HTTP_Session_Container_DB('mysql://user:password@localhost/db'); ini_get('session.auto_start') or session_start();
Came across something like this today, and was wondering if there was an equivalent
Came across a problem whereby I wanted the last time data was imported to
I came across this Linq to Sql code in an application I am maintaining:
I came across a piece of code which looks like this: jQuery(function($) { $('#saySomething').click(function()
I came across this due to a bug in my code and I'm curious
I came across the below lines in code unsigned char A = 0xB9; unsigned

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.