WIth managed dialogs, onCreateDialog is called only the first time the dialog is shown. If you want to show the dialog again and display a message that's different from when the dialog was created, override onPrepareDialog and call setMessage from there (based on the dialog's id if necessary).
HTH, Jef On Aug 4, 1:49 pm, Kostya Vasilyev <[email protected]> wrote: > Andreas, > > public AlertDialog.Builder setMessage (CharSequence message) > > Since API level 1. > > Does this not work for you? > > -- Kostya > > 04.08.2010 18:17, livinberlin пишет: > > > > > Hi everyone, > > > I have a problem with AlertDialogs that seems to be simple, but which > > puzzles me for quite a while now. I'd like to show the user an > > AlertDialog with varying messages (for example, "Number of files: > > <some number>"). I tried different approaches, but none worked for me. > > > When using managed dialogs, I can only pass a dialog id to > > onCreateDialog (I know this was fixed in API level 8, but I need > > compatibility with API level 3). I cannot pass text parameters such as > > <some number>. So this approach seems to work for static messages > > only. > > > When creating and showing the AlertDialog on my own, I have to > > explicitly dismiss the dialog in the Activity method onDestroy > > (otherwise I'd get a window leaked error). With this approach I would > > have to store references to all open dialogs in an activity, which > > seems too tedious for such a simple task. Another problem is that I > > would have to implement dialog persistence at configuration changes on > > my own. > > > Did I miss something? > > > Thanks for any response > > Andreas Glausch > > -- > Kostya Vasilev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- 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

