Android: ListView doesn't populate completely -


I am trying to create an RSS feed reader for my application and I have a strange problem to implement this feed. For I use a list viewer which I adapt with an Arrayist I est.

I know that Arreelist is full of all the areas that I want to show (I print all of them in my logarithm), but when I run the app, all the cells present in my ListView They do not have to fill with the information, the main part of them is textual display, it looks quite random, but which always works correctly is the first element some others do.

And another strange thing is that OnItemClickListener works perfectly, even I am unable to see information in my elements.

Thank you very much in advanced.

I attach my getView code:

  see public getView (int position, seeviewview, ViewGroup parent) {see v = convertView; Adapter wrapper wrapper; If (v == zero) {layout inflator li = (layout inflator) this.getContext () .getSystemService (reference. LEOUT_INFLATER_SERVICE); V = li.inflate (R.layout.itemrow, null); Wrapper = new adapter (v, cont); V.setTag (cover); } And {casing = (adapterwiper) Convertview.gettag (); Ray iitim o = this .gate item (status); If (o! = Null) wrapper.populateFrom (o); Parent.refreshDrawableState (); } Return V; }    

Maybe you do not handle the recycled view case properly in the getView .

When you can see that convertView! To see = Null , you still have to generate information in your convertview, there will be actual scene hierarchy, but the information will be from an old, recycled view attached to a separate line .

For more specific information, please post your getView code.

Edit - I think if you need to call wrapper.populateFrom (o) , you have the convertView is or does not. Try to move that part outside the If statement:

  if (v == zero) {layout inflator li = (layout inflator) this.getContext () .getSystemService (context.LAYOUT_INFLATER_SERVICE ); V = li.inflate (R.layout.itemrow, null); Wrapper = new adapter (v, cont); V.setTag (cover); } And {casing = (adapterwiper) Convertview.gettag (); } RssItem o = this.getItem (status); If (o! = Null) wrapper.populateFrom (o); Parent.refreshDrawableState (); // Not sure what this is doing    

Comments