I'd suggest using fragments and DialogFragment. On Fri, Dec 9, 2011 at 8:24 AM, Royston <[email protected]> wrote:
> I have an odd but repeatable issue with Dialogs and Android lifecycle on a > Nexus (emulated and actual device). I am using showDialog(ID) throughout > and dismissDialog(ID) to remove. In the tests I run I show a dialog with > and ID of 10 and dismiss it, I then show a dialog with an Id of 9 and > dismiss it. I then show a dialog with an id of 7 and turn off the device > (press F7). My Log shows: > > onCreateDialog ID 7 > onPrepareDialog ID 7 > onCreateDialog ID 9 > onPrepareDialog ID 9 > onCreateDialog ID 10 > onPrepareDialog ID 10 > > I.E all three dialogs are recreated but in dialog ID numerical order. If I > unlock the device/emulator dialog with ID 7 is showing but obviously the > code thinks the last dialpg shown is ID 10 so variables are pointing > incorrectly and I get app failure. I understand that dialogs are cached if > dismissed rather than removed but the sequence here is difficult to manage. > Thoughts appreciated. > > Roy > > > -- > 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 -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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

