If you control the other application (Application X), then when you launch
it pass in another value in the extra data part, and don't specify the
screen orientation, but, if the intent has this other value set correctly
then it is forced to landscape mode.

So, basically, the default is to not force the orientation, but give a way
for this other application to be able to request landscape mode.

To make it more flexible, you could just allow programs to request
landscape or portrait mode, if you want it more flexible.

On Sat, Jan 14, 2012 at 11:29 PM, Jay SB <[email protected]> wrote:

> 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
>



-- 
"I know that you believe you understand what you think I said, but I'm not
sure you realize that what you heard is not what I meant."
- Robert McCloskey

-- 
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

Reply via email to