How to rotate video player on button click and on ...
# android
g
How to rotate video player on button click and on orientation change. on button click i am using below code.
Copy code
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE)
and inside onConfigurationChanged() call below code.
Copy 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.
😶 1