I just discovered the same issue, that when the screen orientation is changed, and the owner is recreated, any dialogs are recreated with onCreateDialog but onPrepareDialog does not appear to be called. The relevant sections of code can be found in Activity.java and Dialog.java. When the dialogs are being restored they are created through calls to onCreateDialog, but the dialog state is actually restored through Dialog.onRestoreInstanceState. To me, this design design does not mesh all that well with the existence of onPrepareDialog.
In any case, it is possible to achieve the desired effect by overriding Dialog.onSaveInstanceState and Dialog.onRestoreInstanceState rather than relying on Activity.onPrepareDialog. This is made slightly more difficult since Dialog does not follow the normal Activity lifecycle, ie, there is no onResume called after onRestoreInstanceState, so many of the things that you would normally put in onResume must go into onRestoreInstanceState without interfering with the rest of your dialog. Hope that helps. On Feb 7, 11:15 pm, plusminus <[email protected]> wrote: > Hi all, > > I'm not 100% sure whether this is a bugs, so I'm asking on here. > > Issue #1: > In my Acticity the user is passing trough some dialogs: > > D/OPENSTREETMAP( 1468): Creating dialog: 1 > D/OPENSTREETMAP( 1468): Preparing dialog: 1 > D/OPENSTREETMAP( 1468): Creating dialog: 0 > D/OPENSTREETMAP( 1468): Preparing dialog: 0 > D/OPENSTREETMAP( 1468): Creating dialog: 5 > D/OPENSTREETMAP( 1468): Preparing dialog: 5 > > >While a dialog is open<, the screenorientation is changed manually. > > // Change in ScreenOrientation > D/OPENSTREETMAP( 1468): Creating dialog: 0 > D/OPENSTREETMAP( 1468): Creating dialog: 1 > D/OPENSTREETMAP( 1468): Creating dialog: 5 > > The Bug is in my opinion that onPrepareDialog is not called after the > change of the Screenorientation. > I assume it would happen to the currently opened Dialog. > > Any suggestion is welcomed. > > Best Regards, > plusminus --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

