Screen Orientation

How to programatically change the Screen Orientation in C++

In Android, you have to call a JNI method and force the orientation change in Java

Using code like this:

   setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);

And an override in your Manifest.xml

 android:configChanges="orientation|screenSize"

I want the orientation to change as I Rotate the screen. The app is Display Landscape if the Device is in Landscape mode and the Display Portrait mode if Device is in Portrait mode the problem is in when the
orientation changes. how to Solve it please help?

I am not so sure… but one work around could be use accelerometer event and detect which way the screen is tilted and then according use 4 switch cases and then use whatever @corytrese says inside each one of cases…

It should work, if corytrese method works :smiley: