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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:53:53+00:00 2026-06-09T07:53:53+00:00

I have a ListView which displays in every row an image pulled from the

  • 0

I have a ListView which displays in every row an image pulled from the internet, and a string.

In general it works fine. However I want to take control on the way when the views (rows) are inflated. By default when the row is visible the getView() method of the adapter is called.

This of course is not one of the best behaviours because if I have a ListView with several hundreds of records, and I need to reach the ones at the bottom, while scrolling the ListView, the getView() method will be invoked for every row until I reach the footer.

So I want to call getView only after scrolling and the ListView is in paused/idle state, but I do not have idea how to go about this:

Here’s how I begun:

listView.setOnScrollListener(new OnScrollListener() {
    @Override
    public void onScrollStateChanged(AbsListView view, int scrollState) {
        if(scrollState==SCROLL_STATE_IDLE){
            // Invoke get view only on visible items
        }
    }

    @Override
    public void onScroll(AbsListView view, int firstVisibleItem,
            int visibleItemCount, int totalItemCount) {

    }
});

This is the getView of my adapter:

@Override
public View getView(int position, View convertView, ViewGroup parent) {

    ViewHolder holder;

    if (convertView == null) {
        convertView = mInflater.inflate(R.layout.row, parent, false);

        holder = new ViewHolder();
        holder.title = (TextView) convertView.findViewById(R.id.textView);
        holder.image = (ImageView) convertView.findViewById(R.id.imageView);
        holder.position = position;

        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }


    holder.title.setText(data.get(position).getTitle());
    holder.image.setImageResource(R.drawable.ic_launcher);
    new LoadImageAsync(data.get(position).getUrl(), holder.image).execute();

    return convertView;
}

Please, give me some directions on where should I look in order to achieve this: Call getView() only after scrolling, and only for visible items.

  • 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-09T07:53:55+00:00Added an answer on June 9, 2026 at 7:53 am

    I recently read an article on this… here. I haven’t tried it but it seems like a sound theory.

    Basically, they advocate adding a boolean that you use to track whether you are scrolling or not and use that as a flag in your adapter. If the boolean is true (you are scrolling), only draw the textviews in your layout. If false (you’ve stopped scrolling) you draw everything.

    You tell the adapter to redraw the visible views when not scrolling by using notifyDataSetChanged().

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

Sidebar

Related Questions

I have a ListView which displays a list of string values. I want to
I have a listview which displays items retrieved from the webpage. Each item in
I have ListView , which displays records (movies) from the SQLite DB. Each record
I have a ListView which contains custom rows. This custom row has following UI
I have a listview, which displays a list of administrators, this list is held
I have a ListView which displays information about some entities (all of the same
How do I implement a listview which displays images an text dynamically from the
I have a list (ListView) which which displays a lot of information, and what
I have a listview which displays a lot of info, but when it's empty
I have created a listview which displays all the people in the database. But

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.