I am working on an Android app, for which I would like the user to be able to press a button which either enables or disables auto-rotate. How can I do this with an Intent? I’d imagine I would somehow need to change ACCELEROMETER_ROTATION to 0 or 1, but I don’t know how to do this precisely. I hope maybe one of you guys can help me out!
Share
You can toggle Rotation ON/OFF using ACCELEROMETER_ROTATION as :
and finally add
android.permission.WRITE_SETTINGSpermission in Manifast