Gaurav Tyagi
07/21/2021, 4:50 AMsetRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE)
and inside onConfigurationChanged() call below code.
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE)
new Handler().postDelayed(() -> {
int orientation = getCurrentActivity().getResources().getConfiguration().orientation;
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
}, 1000);
after 1sec player automatcally rotate. in Portrait mode.