GoogleChromeLabs / bubblewrap

Bubblewrap is a Command Line Interface (CLI) that helps developers to create a Project for an Android application that launches an existing Progressive Web App (PWAs) using a Trusted Web Activity.
Apache License 2.0
2.29k stars 152 forks source link

Disable Screen Rotation #840

Open hannandesai opened 6 months ago

hannandesai commented 6 months ago

Hello,

I want to disable app to rotate even if devices's screen rotation is on, I tried below code to disable screen rotation, still it rotates the app in latest android devices when device's screen rotation is on.

1) In LauncherActivity.java I set orientation to portrait. 2) In AndroidManifest.xml I set android:screenOrientation="portrait"

Still it rotates when auto rotation is enabled in device.

Please advice what can I do to disable screen rotation, I tried all other options for orientation like "nosensor", "sensotPortrait", "locked".