Rotation Lock being ignored?

Hi

Wondering if there’s something special I need to do to have my app respect the Rotation Locked setting on android. When testing on nexus 7 / droid 4.4 I lock rotation, but my app still rotates when turning the tablet. 

Any ideas?

thanks

@Mitchell,

What does your build.settings file look like: https://docs.coronalabs.com/guide/distribution/buildSettings/index.html

This small sample will lock to landscapeLeft

settings = {    orientation = {       default = "landscapeLeft",       supported = { "landscapeLeft"},    }, } 

@roaminggamer Sorry if i wasn’t clear - i want my app to respect the fact that the user has locked orientation.

I want to support all orientations, but if the user locks their device orientation, then my app should not rotate when the device does.

Hi @mitchell3,

Which version of Corona are you using? Can you post the contents of your “build.settings” file here please?

Thanks,

Brent

hey brent,

v2014.2189

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", "landscapeLeft" } }, iphone = { plist = { UIStatusBarHidden = true, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXXXXXXX", -- example scheme for facebook "coronasdkapp", -- example second scheme } } } --]] } }, -- Android permissions android = { versionCode = "10", usesPermissions = { "android.permission.INTERNET", "android.permission.WRITE\_EXTERNAL\_STORAGE", "android.permission.CAMERA" }, usesFeatures = { { name = "android.hardware.camera", required = false }, } } }

Hi @mitchell3,

Thanks for the details. I don’t see anything suspicious in the file, so this is likely a bug. Could you please submit a bug report to the following link, along with a simplified test project, and be sure to specify the exact device you’re using?

http://developer.coronalabs.com/content/bug-submission

Thanks,

Brent

thanks brent. will do. 

bug filed.

@Mitchell,

What does your build.settings file look like: https://docs.coronalabs.com/guide/distribution/buildSettings/index.html

This small sample will lock to landscapeLeft

settings = {    orientation = {       default = "landscapeLeft",       supported = { "landscapeLeft"},    }, } 

@roaminggamer Sorry if i wasn’t clear - i want my app to respect the fact that the user has locked orientation.

I want to support all orientations, but if the user locks their device orientation, then my app should not rotate when the device does.

Hi @mitchell3,

Which version of Corona are you using? Can you post the contents of your “build.settings” file here please?

Thanks,

Brent

hey brent,

v2014.2189

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", "landscapeLeft" } }, iphone = { plist = { UIStatusBarHidden = true, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXXXXXXX", -- example scheme for facebook "coronasdkapp", -- example second scheme } } } --]] } }, -- Android permissions android = { versionCode = "10", usesPermissions = { "android.permission.INTERNET", "android.permission.WRITE\_EXTERNAL\_STORAGE", "android.permission.CAMERA" }, usesFeatures = { { name = "android.hardware.camera", required = false }, } } }

Hi @mitchell3,

Thanks for the details. I don’t see anything suspicious in the file, so this is likely a bug. Could you please submit a bug report to the following link, along with a simplified test project, and be sure to specify the exact device you’re using?

http://developer.coronalabs.com/content/bug-submission

Thanks,

Brent

thanks brent. will do. 

bug filed.

I’m also having this problem on an LG G2 and Samsung Galaxy S2, though it does work on an iPad correctly. The rotation lock is simply not respected on Android phones (at least the ones I’ve tried). This is as reported by system.orientation and as handled by the resize event.

I’m also having this problem on an LG G2 and Samsung Galaxy S2, though it does work on an iPad correctly. The rotation lock is simply not respected on Android phones (at least the ones I’ve tried). This is as reported by system.orientation and as handled by the resize event.

Was this ever resolved. We using Enterprise build 2015.2541 and seem to be experiencing the same issue.  

Our app supports both Portrait and Landscape orientations, but when the user locks the devices rotation the app seems to ignore this and carry on rotating anyway. Since we’re using Enterprise, perhaps there is a simple way to fix this that we’ve overlooked?

Can anyone from Corona comment on this? 

I have tried setting android:screenOrientation to use:

android:screenOrientation="user" android:screenOrientation="fullUser" android:screenOrientation="sensor" android:screenOrientation="fullSensor"

and none of these have any effect on this issue.

Was this ever resolved. We using Enterprise build 2015.2541 and seem to be experiencing the same issue.  

Our app supports both Portrait and Landscape orientations, but when the user locks the devices rotation the app seems to ignore this and carry on rotating anyway. Since we’re using Enterprise, perhaps there is a simple way to fix this that we’ve overlooked?