I want to support my application to support only Portrait and left Landscape mode of orientation.
If My app is in Portrait mode and user changes orientation to landscape-left, it should change to landscape mode. But If My app started in Portrait mode and user changes orientation to landscape-right, it should not change to landscape mode.
similarly It should change its mode from left-landscape to portrait.
if(screenOrientation == 0){
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} else if(screenOrientation == 1){
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
I locked the mode depending on screenOrientation value but when to unlock rotation. without unlocking it wont change its mode in any rotation.
is anyone have idea about it?