Search code examples
androidandroid-layoutportrait

Fix layout in portrait mode by configuring in XML layout/flApps.xml


I have a FrameLayout flApp.xml. I would like to use flApp.xml only in portrait mode.

*Can I config in Layout file flApps.xml to work only in portrait mode? *

Note: I don't want to config in AndroidManifest.xml


Solution

  • If you don't want to edit you AndroidManifest.xml you can force portrait mode programatically by using

    setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);