James, Thanks for your response.
I am working on Email application, my requirement is to show all the screen orientation only in landscape mode irrespective of device orientation, only when it launched through one particular application (Application X). If i launch the Email app through some other applications (Application y and z), it should always follow the device orientation. So, to satisfy the above requirement, when Email application is launched from Application x, i have used the API setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) to change the orientation. When my device is PORTRAIT mode, and when its launched through Application X, all the Email screens are initially launched in PORTRAIT (Device orientation )mode and then its switching back to LANDSCAPE mode (because of the above API). How to avoid this screen flickering ? Hope you will understand my problem. Regards, Jayantheesh On Sat, Jan 14, 2012 at 9:51 PM, James Black <[email protected]>wrote: > 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 -- 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

