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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:29:33+00:00 2026-05-23T10:29:33+00:00

Is it possible to define a ‘virtual size’ for ListView in Android and thereby

  • 0

Is it possible to define a ‘virtual size’ for ListView in Android and thereby have it allocate more views and get these earlier before they are visible on the screen? For example, if my listview is 400px high, and my items are 100px high, listview will allocate ~5 item views and reuse these as the list scrolls. Is it possible to define a virtual head and tail size for listview (off-screen) such that items in this space are getView()’ed?

My problem: I have a list with items that each contain a photo read async from storage (sd-card). This entails a certain latency for when the item is ready. When I fling the list, a few top/bottom (flinging down/up) number of new items are in the process of being loaded. The system can keep up => throughput is ok, but the read latency is the problem. If listview could have some extra off-screen items that were scrolled in, this would probably resolve my problem.

Any inputs?

  • 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-23T10:29:34+00:00Added an answer on May 23, 2026 at 10:29 am

    I had a similar problem (loading images into a GridView asynchronously) that I solved by overriding onMeasure() in a GridView subclass. ListView has the same method. My code looked something like this:

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        setMeasuredDimension(getMeasuredWidth(), getMeasuredHeight() + 500);
    }
    

    As I understand it, this will make the view think that it is larger than it actually is on screen, causing it keep more offscreen views alive rather than recycling them. You could change the 500 to whatever size will preload enough images for your application.

    Unfortunately, I’ve found that this doesn’t work when scrolling upwards (only downwards). I haven’t been able to figure out why this is.

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

Sidebar

Related Questions

Is it possible to define a spring-managed EJB3 hibernate listener? I have this definition
Is it possible to define in which schema new tables get created by default?
is it possible to define in a spring context file, and one or more
Is it possible to define a control to have non-specified set of attributes? For
Is it possible to define more than one destination folder in Inno Setup script?
Is it possible to define more than one conditional in one {$IFDEF} directive ?
Is it possible to define a list with a fixed size that's 100? If
Is it possible to define it generically over all types which have a method
Is it possible to define a member function which have the return type same
Possible Duplicate: Is it possible to define more than one function per file in

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.