It sounds like your requirements, or understanding is off, so you may want to check it out.
The confusion is, if you automatically switch to landscape always then set it in the manifest. If you start in portrait mode then why switch them? Or what should happen differently on this orientation? On Jan 14, 2012 9:20 PM, "Jay SB" <[email protected]> wrote: > Hi All, > > As far as i know, screen orientation can be changed by two ways, one is > through Manifesto file and other is through code by setRequestedOrientation > API. > > My requirement is to show the screen orientation in Landscape mode, only > when it launched through one particular application. > > To satisfy the above requirement i cannot use the first solution, i.e.. > setting the screen orientation through Manifesto file, since it always > launch the activity in the specified orientation. So, now I am forced to > take up the second solution, i.e.. setting the orientation through code by > calling setRequestedOrientation > (ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE). > > I am facing a problem with this approach, if my tablet is in LANDSCAPE > mode, this solution works perfectly fine. But when my device is in PORTRAIT > mode, initially it launches the activity in PORTRAIT mode and immediately > changes the orientation to LANDSCAPE mode. How this flickering can be > avoided ? Please through some light to handle this requirement. > > Manifesto file snippet: > > <activity > > android:name=".activity.setup.AccountSetup" > > android:label="@string/account_setup_title" > > android:theme="@style/AccountSetup" > > android:configChanges="orientation|keyboardHidden"> > > </activity> > > > > Code snippet: > > @Override > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > if (App.SETUP_WIZARD_FLOW == true) { > > > setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); > > } > > setContentView(R.layout.main); > > } > Regards, > Jayantheesh > > -- > 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 -- 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

