checkbox - Android Multispinner - how to update the checkboxes? -


i'm using multispinner code can found in every topic asking multispinners.

@override public boolean performclick() {     if (mainactivity.getsharedinstance().mp != null)         if (mainactivity.getsharedinstance().mp.isplaying())         {             mainactivity.getsharedinstance().mp.stop();             //mainactivity.getsharedinstance().mp.release();         }     alertdialog.builder builder = new alertdialog.builder(getcontext());     builder.setmultichoiceitems(             items.toarray(new charsequence[items.size()]), selected, new dialoginterface.onmultichoiceclicklistener() {                  @override                 public void onclick(dialoginterface dialog, int which, boolean ischecked) {                     if (which == 0)                     {                         if (ischecked == true)                         {                             selected[0] = true;                             selected[1] = false;                             selected[2] = false;                             selected[3] = false;                             selected[4] = false;                             selected[5] = false;                             selected[6] = false;                             selected[7] = false;                         }                         else                             selected[0] = false;                     }                     else                     {                         if (ischecked == true)                         {                             selected[which] = true;                             selected[0] = false;                         }                         else                             selected[which] = false;                     }                    }             });     builder.setpositivebutton(android.r.string.ok,             new dialoginterface.onclicklistener() {                  @override                 public void onclick(dialoginterface dialog, int which) {                     dialog.cancel();                 }             });     builder.setoncancellistener(this);     builder.show();     return true; } 

i want multispinner uncheck other checkboxes if first 1 picked , uncheck first 1 when if else gets picked.

the result of code above when i'm in multispinner dialog doesnt work, if check first checkbox , close reopen multispinner other checkboxes updated , unchecked wanted.

how can without needing close , reopen multispinner dialog?

thx ur help.

for having same problem use update dialog:

((alertdialog) dialog).getlistview().setitemchecked(which, false);


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -