Screen Orientation on android

0

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.

    
asked by anonymous 26.05.2015 / 05:35

1 answer

2

Try to put it like this:

activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
     

getSupportActionBar (). hide ();   getWindow (). addFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN);

    
26.05.2015 / 12:42