> > Here the problem is you inflating only one xml file in each view , so if > your disabling button in one view it will effect in all views. > This is not the reason for the problem...
I have a listview which has a button in each row of listview,What I am > doing is on click of 2 nd row button I am disabling it, after scrolling > the listview whe i come back to 2nd row of listview , even buttons in the > 3rd and 4th row are also disabled, though i did not disable them. > This is very likely due to view recycling, which is used to help the listview scoll efficiently when there is a large amount of data. Fixing this problem is a multi-step process: 1. Keep track of the button state (enabled/disabled) in the adapter 2. When a button is clicked, set the state in the adapter and call notifyDataSetChanged() 3. In the getView() method of your adapter, set the state of the button based on the adapter data It would also be beneficial to implement the ViewHolder pattern... You can find many examples online by searching for something like "Android ViewHolder Pattern" Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Fri, Oct 5, 2012 at 2:39 AM, rambabu mareedu <[email protected]>wrote: > Here the problem is you inflating only one xml file in each view , so if > your disabling button in one view it will effect in all views. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

