1

Hey i'm trying to create a behavior like YouTube full screen button.

I have a button that will force rotate from portrait to landscape. And it should stay in landscape till the user rotates the device to landscape and back to portrait.

My problem is that when i use getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)

And the phone is in portrait the view rotates to landscape for a second and Straight back to portrait.

ilan
  • 4,402
  • 6
  • 40
  • 76
  • Youtube doesn't lock the screen orientation, if you tilt your phone in portrait position after tapping fullscreen, it goes back to the portrait view – Ephi Mar 26 '19 at 10:21
  • @Ephi if you hold the phone in portrait and press full screen it stays in full screen – ilan Mar 26 '19 at 13:09
  • 1
    I see what you mean, my bad. Have you checked [this thread](https://stackoverflow.com/a/23489227/4993997) ? – Ephi Mar 26 '19 at 13:16
  • Thanks @Ephi, that thread worked for me. – ilan Apr 03 '19 at 12:10

0 Answers0