Wednesday, August 4, 2010

Re: [android-developers] Displaying parameterized text in AlertDialog

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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment