Saving checkbox checkedstatus
Is there a way to save if the checkbox is checked or unchecked, in the cache in Android?
I have a listview and when i am clicking on an item a new activity pops up with information about that specific item. In that activity there i开发者_开发问答s a checkbox, if i check it and go back to the listview and go into that listitem again, the checkbox is unchecked.
Thanks for your time.
you can use SharedPreferences or create a static boolean variable and call that value in the onCheckedChanged override method and update this value in it.
Maybe you can save boolean value in data storage like shared preference. Show stored checked status on pop up, save if checked status changed.
精彩评论