java - How to not close AlertDialog android -


hi problem when select item alertdialog dismiss

alertdialog = new alertdialog.builder(getactivity()); alertdialog         .setsinglechoiceitems(agearr, 1, btnselectitem)         .setpositivebutton(r.string.dialog_ok, btnpositiveagedialog)         .setnegativebutton(r.string.dialog_cancel, null)         .show(); 

what dialog click positive looks is.

private dialoginterface.onclicklistener btnselectitem = new dialoginterface.onclicklistener() {     @override     public void onclick(dialoginterface dialog, int which) {         selectedindexage = which;     } }; 

i tried setting listener null , not close still needed because wanted know item selected

just put it

itemview.setonclicklistener(null); 

or

you can use implementation of hasonclicklisteners() knowing status of listener taken android.view.view class

 public boolean hasonclicklisteners() {         listenerinfo li = mlistenerinfo;         return (li == null && li.monclicklistener == null);     } 

use following link further modifications

set listener instance in fragment on application restore


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -