Disable display turning

edited February 2014 in Android Mode

Hi, I made a game for android using processing. When someone accidently tuns the display the game will reset (hours of gaming have been lost :/ ). I found ways how to disable display rotation of your phone. But is there a way to prevent it from processing directly or a way to only turn it off when processing is running?

Answers

  • Answer ✓

    It is possible to lock the orientation of your sketch. Open the AndroidManifest.xml file in the sketch folder and add the following value to the <activity> tag:

    android:screenOrientation="portrait"
    

    Or, if you want to use landscape orientation, change portrait to landscape.

  • Exactly what I was looking for. Thank you so much! :D

Sign In or Register to comment.