The solution was: removeDialog(int).

Evi


2009/10/30 Éva Lovrencsics <[email protected]>:
> Hello,
>
> I have an AlertDialog with single choice items, but these items
> sometimes change, so I have to update the radiobuttons array every time
> when the dialog is showed.
> I know there is a method called onPrepareDialog but the Dialog doesn't
> have the setSingleChoiceItems, only the Builder.
>
> Here is my onCreateDialog:
>
> protected Dialog onCreateDialog(int id) {
>               Dialog dialog;
>
>               case DIALOG_SOMETHING:
>               {
>                       final CharSequence[] radiobuttons;
>                       int checked;
>
>                       //... here I fill radiobuttons array and set
> the checked item.
>
>                       // create dialog
>                       AlertDialog.Builder builder = new
> AlertDialog.Builder(this);
>           builder.setTitle("title")
>           .setSingleChoiceItems(radiobuttons, checked, new
> DialogInterface.OnClickListener() {
>               public void onClick(DialogInterface dialog, int radioitem)
>               {
>                       // ...
>               }
>           })
>           .setPositiveButton("OK", new DialogInterface.OnClickListener() {
>               public void onClick(DialogInterface dialog, int id)
>               {
>                       // ...
>               }
>           });
>
>                       dialog = builder.create();
>
>                       break;
>               }
>
>
>               default:
>                       dialog = null;
>               }
>
>               return dialog;
>       }
>
>
> If I copy this code to onPrepareDialog, nothing happens. :-(  The
> dialog doesn't update my radiobuttons.
> What can I do?
>
> Evi
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to