I want to create checkbox in my preference Activity that allows user to toggle orientation change.
In similar questions people write only about complete orientation loc
I don't understand what is the problem with the setRequestedOrientation.
The SCREEN_ORIENTATION_SENSOR combine to landscape or portrait seem what you want, no?
if(....)
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
else if(....)
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
else if(....)
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);