i am designing a simple android app,which has a check box displayed in the list view and my application is giving a alarm when the corresponding check box is checked.But while i am moving from that screen to my home screen and again coming back to my page containing the check box it doesn’t show that which check box i checked previously.
Please help me regarding this topic,
than x in advance..
Probably you are setting it as checked/unchecked somewhere (like in the
onResume()or elsewhere) so it’s state is reset each time you enter this activity.If the checked state must persist between app runs, you could store the checkbox state in a SharedPreference and in the
onResume()use the setChecked method with the value of the preference…Else you can try not to overwrite anywhere the checkbox state or store it in a class field or something to reset it to the desired value when the activity return to front