alertdialog - In Android multiple checkboxes, checkbox Remain checked that I have selected even when close my app -
i have 3 checkboxes in alertdialog. want when click on sencond checkbox remain checked until user desn't click on other checkbox per his/her convince. here code please provide sugestions.
edit: means 1 checkbox remain clicked application closed user.
my code:
case sync_alert: alertdialog.builder alertbuilder = new alertdialog.builder(this); alertbuilder.setmessage("synchronization"); alertbuilder.setcancelable(false); layoutinflater buildinflater = this.getlayoutinflater(); view syncview= buildinflater.inflate(r.layout.sync_layout, null); alertbuilder.setview(syncview); defaultchkbox = (checkbox)syncview.findviewbyid(r.id.defaultchkbox); after15mint = (checkbox)syncview.findviewbyid(r.id.after15mint); afternmint = (checkbox)syncview.findviewbyid(r.id.afternmint); alarms = (alarmmanager) getapplicationcontext().getsystemservice(context.alarm_service); alertbuilder.setpositivebutton("ok", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { //implement search method here if(defaultchkbox.ischecked()) { //some code here } else if(after15mint.ischecked()) { //some code here } else { //some code here } } }); alertbuilder.setnegativebutton("cancel", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { dialog.dismiss(); } }); alertdialog alertdialog = alertbuilder.create(); alertdialog.show();