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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:18:50+00:00 2026-05-24T03:18:50+00:00

I have a problem with ListView. the thing is that when I click on

  • 0

I have a problem with ListView. the thing is that when I click on any item from list, all elements are changing their positions. I’ve made ListViewAdapter that extends BaseAdapter and in getView I take data from public static ArrayList of items which is populated by AsyncTask with ProgressBar (which is called at the end of onCreate() ). The ListView takes new adapter only once. I have made neither notifyDataSetChanged() method on adapter nor any kind of invalidate(). ArrayList of items isn’t changed from code anywhere. Thanks to debugger I know that items are relocating after finishing onItemClick() method (which has only three lines: declare new Intent, put extras and startActivity() ) from ListView, but before first line from the new Activity’s onCreate(). I don’t know where to search for the reason of that issue. Any suggestions? What kind of source code will help here?

Here’s getView():

 public View getView(int position, View convertView, ViewGroup parent) {
             ViewHolder holder;
             if (convertView == null) {
                 convertView = mInflater.inflate(R.layout.trophies_listitem, null);
                 holder = new ViewHolder();

                 holder.text = (TextView) convertView.findViewById(R.id.TrophiesListItemName);
                 holder.text2 = (TextView) convertView.findViewById(R.id.TrophiesListItemSpecies);
                 holder.text3 = (TextView) convertView.findViewById(R.id.TrophiesListItemWeigth);
                 holder.text4 = (TextView) convertView.findViewById(R.id.TrophiesListItemJagdrevier);
                 holder.photo = (ImageView) convertView.findViewById(R.id.TrophiesListItemPhoto);
                 holder.label1 = (TextView) convertView.findViewById(R.id.TrophiesListLabel1);
                 convertView.setTag(holder);
             } 
             else {
                 holder = (ViewHolder) convertView.getTag();
                 return convertView;
             }

             DownloadedTrophy t = (DownloadedTrophy) trophies.get(position);
             holder.text.setText(t.getTrophy_title());
             if(t.getTrophy_species()!=null && t.getTrophy_species().length()>0 && Integer.parseInt(t.getTrophy_species())>0) 
                 holder.text2.setText(Main.mSpecies.getItemByKeyValue("id", String.valueOf(Integer.valueOf(t.getTrophy_species()) - 1)).get("name"));       
             holder.text3.setText(t.getTrophy_weight());
             holder.text4.setText(t.getTrophy_place());

             byte [] picture = t.getPictureSmall();
             if(picture!=null){
                 Bitmap bm = BitmapFactory.decodeByteArray(picture, 0, picture.length);
                 holder.photo.setImageBitmap(bm);
                } else {
                    Bitmap bm;
                    bm = BitmapFactory.decodeResource(res,R.drawable.trophy_none);
                    holder.photo.setImageBitmap(bm);
                }

             holder.label1.setText("Ort:");

             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-05-24T03:18:52+00:00Added an answer on May 24, 2026 at 3:18 am

    You’re reusing View’s for different elements (a good thing) but your ViewHolder object’s reference will still hold references to the previous elements objects. It would be better (and work) to re-find them.

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

Sidebar

Related Questions

The problem is that I have two listView but one itemClick method, if I
I have a little problem with a Listview. I can load it with listview
I have a problem, I am using the method in listview ListView.SelectedItems[0] to return
I have the following problem. The background color in a ListView is set LightGreen
I have problem in some JavaScript that I am writing where the Switch statement
I have problem with return statment >.< I want to store all magazine names
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I have a an Android ListView that has small (say, 1-5 frame) stutters as
I have a listview that uses a customadapter based on the baseadapter. The listview
I have a MainActivity class with an Add Item button and a listview and

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.