I am trying to let the framework manage my alertDialogs. I have no trouble creating the alertDialogs using onCreateDialog(), and I am able to do some "on-the-fly" updating of these alertDialogs using the following code in onPrepareDialog():
protected void onPrepareDialog(int id, Dialog dialog) { AlertDialog alertDialog = null; switch (id) { case DIALOG_PUBLIC_INFO: alertDialog = (AlertDialog)dialog; alertDialog.setMessage(mPubInfoText); // <-- updates msg since onCreateDialog called break; } } However, I also have alertDialogs which display an array in a list format created using AlertDialog.Builder: protected Dialog onCreateDialog(int id) { switch (id) { case DIALOG_PUBLIC_INFO: return new AlertDialog.Builder(BaseGalDataDisplay.this) .setTitle(r_title) .setItems(array, new DialogInterface.OnClickListener() { // <-- array to display in the list public void onClick(DialogInterface dialog, int which) { // do stuff... } }) .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { /* User clicked OK so do some stuff */ } }) .create(); } } THE PROBLEM: How can I change the displayed list/array "on the fly", after the alertDialog has been created in onCreateDialog() like I did using " .setMessage() " in onPrepareDialog(). The AlertDialog class has no methods to update the list/array directly. Thanks for any guidance. Jim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---