I had a similar problem. I used showDialog (int id, Bundle args) and implemented
protected Dialog onCreateDialog(int id,Bundle args) { switch(id) { case ...: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setPositive... return builder.create(); } }
My mistake was that before creating a new dialog box I had to use removeDialog (int id), since Android somehow caches the dialog and does not call onCreateDialog () every time showDialog () is called. Therefore, my decision caused
removeDialog(id); showDialog(id,args);
and modifying onCreateDialog () by deleting all possible dialogs before the switch statement to avoid conflicts with any other cached dialog.
source share