android - How to pass value in AlertDialog.Builder setSingleChoiceItems? -


i develop in android app.my problem used alert dialog box , pass value in setsinglechoiceitems. coundn't pass value . sourcecode below .please give me solution.

public void alertboxshow(int position) {         int pos=position;         log.v("log_tag"," position ::"+pos);         final charsequence[] items = { " 5 ", " 10 ", " 15 "};          alertdialog.builder alt_bld = new alertdialog.builder(this);         alt_bld.setsinglechoiceitems(items, -1,                 new dialoginterface.onclicklistener() {                     public void onclick(dialoginterface dialog,  int which) {                          switch (which) {                         case 0:                             //updatestatus(pos);                             dialog.dismiss();                             // code when first option seletced                             break;                         case 1:                             // code when 2nd option seletced                             dialog.dismiss();                             break;                         case 2:                             dialog.dismiss();                             // code when 3rd option seletced                             break;                           }                      }                    });         alertdialog alert = alt_bld.create();         alert.show();     } 


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -