For my Android app, the value returned for activity.getResources().getConfiguration().orientation is always 1 (ORIENTATION_PORTRAIT), even when the device is in landscape mode. This is happening specifically on Samsung galaxy devices. This is causing my fragment to use the portrait layout instead of the landscape layout present in the project. Is there a different way to check the orientation on Samsung devices? Is anyone else facing the same issue?
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
// Get device orientation
Configuration config = activity.getResources().getConfiguration();
mOrientation = config.orientation;