java - Is it possible to save checkBox state while switching layout or class? And if its possible how? -
when remember tutorial checkboxes please let me know!
you're getting state using:
boolean selected = checkbox.ischecked();
then can add onlayoutchangelistener
on view object.
example usage:
view.addonlayoutchangelistener(new onlayoutchangelistener(){ public void onlayoutchange(view v, int left, int top, int right, int bottom, int oldleft, int oldtop, int oldright, int oldbottom){ boolean selected = ((checkbox)v.findviewbyid(r.id.yourcheckboxid)).ischecked(); //savethestatehere } });
Comments
Post a Comment