John,

Do you, perhaps, call showDialog() for the dialog each time in onCreate?

If savedInstanceState in onCreate != null, your code should not call showDialog, as the dialog would already exist in the managed dialog list and be restored shortly.

-- Kostya

23.03.2011 0:43, John пишет:
On Mar 22, 3:24 pm, Miguel Morales<[email protected]>  wrote:
Well it should, but I suspect you are doing something wrong by creating a
new AlertDialog every time.
I haven't really used that method to construct dialogs, but rather keeping
track of them myself.
(by holding on to the reference and releasing it when necessary.)

It seems that those methods are deprecated any way, you may want to look
into a different solution that will work now and in the future.
I didn't know about the deprecation, but now that you mention it the
showDialog(int) method is deprecated, but they've replaced it with
showDialog(int, Bundle), which should work the same way.

The benefit to using showDialog is that it handles rotation for me, so
the dialog is still there even when the user rotates the phone. And no
extra code on my part.

What benefit is there to keeping track of your own references?

And why aren't my replies showing up in the thread? Did I reply
directly to your email instead of the group?



--
Kostya Vasilyev -- 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

Reply via email to