This method has a problem in Android 2.2 which cannot detect the difference between portrait and reverse portrait, for example. Later versions of Android maybe OK with it though.
On Jul 9, 8:10 am, limtc <[email protected]> wrote: > My original reply was deleted by someone, not sure why. > > But anyway, that won't work. This is because we do not know what > orientation is in when the app started. > > My solution is to detect res.getConfiguration().orientation, > then setRequestedOrientation to the current orientation. This works nicely. > It can works in both orientations, and once the app started, the > orientation won't changed. > > 在 2012年7月9日星期一UTC+8下午4时10分45秒,Ali Chousein写道: > > > > > > > Yes, one approach is to do it using > > android:screenOrientation="portrait|landscape" in the manifest. Once I > > wrote a short blog sharing my experiences on how to handle screen > > orientation. This approach is also explained in it: > >http://android-screen-layout.blogspot.be/ > > > ------------------------------------------------- > > Ali Chousein > >https://play.google.com/store/apps/details?id=com.apps.social_nav > >https://play.google.com/store/apps/details?id=com.apps.weather_buddy > >http://www.paygol.com/android/implementation > > > On Monday, July 9, 2012 5:24:11 AM UTC+2, limtc wrote: > > >> Is it possible to allow the app to start in either landscape or portrait, > >> but ONCE the app started does not allow rotation? > > >> Thanks! -- 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

