ViewPager with fragments. Can be managed for different fragments in different ways



  • ViewPager with fragments as a deposit. One of the fragments should be portrait-oriented. Everyone else has to spin the screen. How do you do that? Android 4.4 and above.



  • Use the fragment you need.

    getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    

    Other fragments

    getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2