You just need to deal with being restarted due to a configuration change. Note that even if you force an orientation, this can still happen due to the user opening a keyboard, changing the locale, and for many other reasons.
It is true that even if you specify a particular orientation, you may see switches to other orientations in some cases as the user transitions in and out of your app. That doesn't mean your app needs to display and run properly in the other orientation, just don't crash and deal with the config being changed (which you need to do anyway). On Mon, Feb 14, 2011 at 8:13 AM, Kim <[email protected]> wrote: > Thanks Diane. > I see my thinking was wrong. I thought that in the manifest, the > designer can tell the OS that all of the activities are protrait and > should never get notified of a change in orientation outside of your > activity (except if implementing onConfigurationChanged). > I was hoping to tackle all of the complexities of orientation changes > at a later date, since the app itself is pretty complex already :-). > > Just curious, I notice that if the user is in my app and the user hits > the home button, Android stays in the orientation the app was in. > Then, when the user turns the device, the orientation changes, but my > sleeping app does not go through the onDestroy()/onCreate() change > configuration callbacks. > Why would it not be similar, when the device is going to sleep? I.e., > put the app to sleep, change configuration if it wants to (but don't > do the callbacks, since the app specifically said it does not support > landscape), and when it returns from sleep, discover that the app is > portrait only so change to portrait and restart app? > > So, just to be sure I understand, there is really no safe way to > create an app that does not handle both orientations? > > Kim > > On Feb 14, 1:46 am, ko5tik <[email protected]> wrote: > > On Feb 14, 6:09 am, Dianne Hackborn <[email protected]> wrote: > > > > > This isn't specific to the dell streak. In the standard platform, the > lock > > > screen forces the orientation to portrait, so when going to sleep if > the > > > screen is landscape then it will get changed to portrait. As always, > an app > > > should handle being destroyed and recreated. > > > > My application (now in beta) does this, bit it is being recreated > > with portrait > > mode - so all the code recomputing screen coordinates in camera > > coordinates > > goes haywire. Not sure how to tackle this... > > > > (This happens on motorola defy) > > > > regards, > > -- > 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

