Changing orientation in Android after resume

Hi,

I’ve set DispFixRot = 2, CCDirector::sharedDirector()-> to landscape, everything is ok. But after I resume my app from background my game canvas looks like it displayed in portrait mode, it is still landscape, but pictures scaled that they dont fit the screen size anymore (~ 2 times higher and 2 times more narrow).
Maybe I should set some parameters when getting to pause or back to resume, but seems like programm doesnt enter to AppDelegate::applicationDidEnterBackground() or AppDelegate::applicationWillEnterForeground() during this sleep and wake up.

I havent such a problems if set device screen orientation to portrait and CCDirector::sharedDirector()->setDeviceOrientation(kCCDeviceOrientationPortrait). after many sleep and resume app still looks like it should. And i think there is no such a thing in nokia e7, cant test on iOS…

Roman.

Hi Roman,

Have the same problem on Android. On iOS works ok for suspend/resume app, but there are problems with rotating device: screen stays as is, but seems like “touch dispatcher” is rotated.

On Android this issue can be fixed by not using DispFixRot = 2 but rather setting screen orientation using CCDirector::sharedDirector()->setDeviceOrientation(kCCDeviceOrientationLandscape) in applicationWillEnterForeground and applicationDidFinishLaunching.