0

I'm coding a food-ordering app that relies on an expandable listview. When the user selects a quantity from a spinner inside the childview, a button in the groupview should update (from grey to green) to signify the user has picked a quantity in the group.

My problem is refreshing the expandablistview immediately upon the user clicking the spinner. If I use notifydatasetchanged or listview.notifyallviews, this blocks the whole program because the onitemselectedlistener of the spinner is constantly calling the line. Note this doesn't return an error, it's a legitimate program run but the fact of calling notifyallviews after an onitemclicklistener causes the program to be stuck in an endless view update.

I'm not attaching any code because I don't think anythign I wrote will help you. The above description should be giving you all the elements of the problem.

Looking forward to help!

Laurent
  • 1,554
  • 19
  • 42
  • One workaround is to design a viewflipper that has two identical views containing a spinner. If the user clicks on the spinner, the view changes; if we find a way to identify the view change --> we can register that instead of the spinner selection and use it to update our views on every user change. Any thoughts? – Laurent Aug 17 '12 at 08:44
  • Anyone out here? I found the solution - using the holder variable to keep track of whether a button was previously clicked (which helped me restore the quantity values of the spinner) --> that value can also tell me the value of the previous click; which allows me to tell if the new value is different from the old one. – Laurent Aug 19 '12 at 01:15

0 Answers0