I have an activity that has been declared in the manifest as portrait, and I have a gallery of images, where when I click on some of the images I launch this code:
getSupportActionBar (). hide (); getWindow (). addFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN);
To make the image redirect by placing the device horizontally I tried this:
activity.setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
Most functions ignore the hide and the fullscreen flag set.