Tuesday, 15 March 2011

Android listview row changing values -


I have a ListView that contains 3 types of elements: Rows and rows that are a bit complex set of subcontrols, and only Text View Hedarwarov What do I do, adding headers, few quarters, headers, and some rows QueueRow needs to make every other update. This is the reason I wrote a code that indicates the data set in the adapter. It updates every second queuro, but there is a problem too - my two headers change from half to second place. After every 0,5 s they swap. Do you have any idea how to stop them?

That is my code:

  Class Building Adapter expands Arrayadaptor & lt; BaseRow & gt; {Private Static Bitmap SOURCE_BITMAP; Private main activity main activity_; Private handler handler_; Private runner runnable_; Public Building Adapter (Main Activity Main Activity) {Super (Main Activity, R. Lay.ro); This.mainActivity_ = Main activity; Source i handler_ = new handler (); Runnable_ = new Runnabel () {@ Override Public Wide Run () {notifyDataSetChanged (); If (hequites ()) handler_pest delighted (runn_b, 1000); }}; } @ Override Add Public Zero (Berevov Object) {If (! Is hequiites) and Object.Gate class (.) Equal (QoRRO class)) Handler_Pist Delayed (Runnabal_, 1000); Super.add (object); } Private bullion hackquites () {for (int i = 0; i & lt; getCount (); ++ i) {if (iitm (i) .getClass (.) Equal (quarro class)) true back; } return false; } @ Override Public Intimate Image Tip (Int Position) {Return Mill Eatam (Position) .getType (); } @ Override Public Entry Popup () {Return 3; } @ Override public view getView (last integer position, seeviewview, ViewGroup parent) {int type = getItemViewType (status); See line = convertview; Switch (Type) {Case Bessarro QUEUE_ROW: {queueRowViewHolder holder = new queerrowholder (); // See whatever convert convert; } Case Besorov .ROW: {Rowhuhlder Holder = New Roewahlder (); // See whatever convert convert; } Case Bias.HADARO: {HeaderViewholder Holder = New HeaderWihilder (); If (line == zero) {layout inflator inflator = (layoutInflator) getContext () .getSystemService (reference. LEOUT_INFLATER_SERVICE); Line = inflater.inflate (R.layout.header_row, guardian, incorrect); Header Header Rau = (Header) Getitem (status); Holder .nameTextView_ = (TextView) line .FindViewById (R.id.categoryNameTextView); Holder.nameTextView_.setText (headerRow.getName ()); Row.setTag (holder); } And {holder = (header vailler) row.getTag (); } Return line; }} Return tap; } Fixed class queueRowViewHolder {ImageView qItemImageView_; TextView qItemNameTextView_; Progress Bar qProgressBar_; TextView qLevelTextView_; TextView qTimeTextView_; Int location_; } Fixed class RowViewHolder {ImageView itemImageView_; TextView nameTextView_; TextView levelTextView_; TextView woodTextView_; TextView lowertextview_; TextView stoneTextView_; Textview goldtextview_; Button ActionButton_; TextView time text View_; } Fixed class header violador {TextViewNetViewView; }    

OK! I have found - I did not set the value of the header;)

No comments:

Post a Comment