Karan Rana
Karan Rana

Reputation: 638

application with number of activities having different orientations

In our application i have four tabs and on first tab m showing three option on click of first tab. Three option are:- 1) camera view. 2) Map View 3) ListView.

I need whole applicatin in portrait mode except mapview and camera view. We need to display these view in porttrait mode as well as in landscape mode. I have set android:screenOrientation="portrait" in manifest file for tab activity.

I have no idea how i can change at run time for different activities, different-2 orientation in tabview.

Help will be appriciated.

Thanks

Upvotes: 0

Views: 122

Answers (3)

Shivansh Saxena
Shivansh Saxena

Reputation: 196

hi u can use this code...

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

Upvotes: 2

Akram
Akram

Reputation: 7526

I need whole applicatin in portrait mode except mapview and camera view. We need to display these view in porttrait mode as well as in landscape mode. I have set android:screenOrientation="portrait" in manifest file for tab activity.

You need to set android:screenOrientation="portrait" in manifest for each activity which are being displayed in Tabs.

or you can do it in your java file like Dr. Dredel suggested for each activity

Upvotes: 0

Yevgeny Simkin
Yevgeny Simkin

Reputation: 28379

You can call this method at any time:

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

Upvotes: 0

Related Questions