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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:31:37+00:00 2026-06-18T05:31:37+00:00

I’m working on a ListView based app and I have a very weird problem,

  • 0

I’m working on a ListView based app and I have a very weird problem, my ListItems are reappering and the correct item is not shown in the correct spot. For the sake of making this easy to understand I’ve set the text on each ListItem to be the same as it’s position. I’m doing this in my adapters getView() call. If I have my Nexus 7 4 ListItems are visible. If I have a total of 10 ListItems then it will go like 0, 1, 3, 4, 0, 1, 2, 3, 4. This goes for all devices meaining that the number of items initially on screen + 1 will be correct while all other ListItems are rearrenged.

In which part of my code do you guys think my problem lies because right now I’ve been trying to fix this for hours and I’m clueless. All help is very much appreciated.

EDIT:

Here’s my getView():

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    CountdownItem ci = mTitle.get(position);

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

        holder = new CountdownViewHolder();
        holder.mTitle = (TextView) convertView.findViewById(R.id.textPrim);
        holder.mSubtitle = (TextView) convertView
                .findViewById(R.id.textSec);
        holder.mDayProgress = (ProgressBar) convertView
                .findViewById(R.id.day_progress);
        holder.mMonthProgress = (ProgressBar) convertView
                .findViewById(R.id.month_progress);
        holder.mYearText = (TextView) convertView
                .findViewById(R.id.year_text);
        holder.day_help = (TextView) convertView
                .findViewById(R.id.day_help);
        holder.month_help = (TextView) convertView
                .findViewById(R.id.month_help);

        holder.setTitle(Integer.toString(position) + " Title");
        holder.setSubtitle(ci.getSubtitle());
        holder.fixImageAndText(position);

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

    return convertView;
}
  • 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-18T05:31:39+00:00Added an answer on June 18, 2026 at 5:31 am

    You aren’t using the ViewHolder pattern correctly. The following code needs to be moved outside the if/else clause and before return convertView:

       holder.setTitle(Integer.toString(position) + " Title");
       holder.setSubtitle(ci.getSubtitle());
       holder.fixImageAndText(position);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small JavaScript validation script that validates inputs based on Regex. I
I've tracked down a weird MySQL problem to the two different ways I was
I have been unable to fix a problem with Java Unicode and encoding. The
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.