Вопрос

i have developed an application that works only with a portrait layout. Actually it has only one layout resource used for all screens.

Now i want that with some screens (especially tablet screens) the layout is different from other devices, and especially i want to use a fixed landscape orientation.

Actually in the manifest i forced the main activity to have portrait orientation:

    <activity android:name=".launchActivity"
              android:label="@string/app_name" android:screenOrientation="portrait" android:clearTaskOnLaunch="true" android:finishOnTaskLaunch="true">

Now how i can manage to have 2 different "fixed" orientation? It can be done via xml or i need to handle them programmatically?

Это было полезно?

Решение

Handle it programmatically. use setOrientation method.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top