I want to find the camera screen orientation in locked portrait orientation mode, well I am using camera in my fragment class and I have already set my screen orientation as
You gonna have to use:
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
//do your stuff with the button
}
}
If you want your activity not to be recreated during orientation then use
android:configChanges="orientation|keyboardHidden|screenSize"
If you want your activity to be forced to stay portrait then you gonna have to use
in your manifest file in the activity you would like just try android:screenOrientation="portrait"
Hope it helps!!!