Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Landscape orientation doesn't work in Corona Native Android builds
Started by mitsik May 29 2019 09:21 PM

1 reply to this topic
native android orientation landscape portrait

Best Answer mitsik , 30 May 2019 - 01:22 AM

just for someone who is looking for an answer:

android:screenOrientation="sensor", not android:screenOrientation="portrait"

<activity android:name="com.ansca.corona.CoronaActivity"
            android:screenOrientation="sensor"
            android:configChanges="keyboard|keyboardHidden|navigation|screenSize|orientation"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

mitsik

[GLOBAL: userInfoPane.html]
mitsik
  • Enthusiast

  • 32 posts
  • Corona SDK

Hi,

I have a problem with orientation in Android native build. It works great in simulator and for ios ( and even for Android version built with Corona Simulator )

I have "orientation" event on device with correct event.type (it shows "portrait" and "landscapeLeft" as type) but it actually doesn't rotate an activity (screen). 

and display.contentWidth and display.contentHeight don't change when I get orientation event.

I didn't change AndroidManifest.xml 

 

how to fix that or maybe force activity rotation?

 

Thanks



[TOPIC: post.html]
#2

mitsik

[GLOBAL: userInfoPane.html]
mitsik
  • Enthusiast

  • 32 posts
  • Corona SDK

  Best Answer

just for someone who is looking for an answer:

android:screenOrientation="sensor", not android:screenOrientation="portrait"

<activity android:name="com.ansca.corona.CoronaActivity"
            android:screenOrientation="sensor"
            android:configChanges="keyboard|keyboardHidden|navigation|screenSize|orientation"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>



[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: native, android, orientation, landscape, portrait