Android Question Problem in Checkbox and Checked state

Pooya1

Active Member
Licensed User
I have Checkbox that when i checked it,In CheckedChange event,i send checked state to server and save it
Now when i close activity and again go to this activity,I read data from server
and i value is 1 so i checked Checkbox
It is OK
But because i send data to server in CheckedChange event,so when i checked checkbox,the CheckedChange event rerun again
How do i prevent this event?
 

KMatle

Expert
Licensed User
Longtime User
Define an extra variable in Globals like "preset". Set it to true before you are presetting the values. In the event sub check it and do nothing. If all presets are done, set it to false and the event sub is working like you need.
 
Upvote 0
Top