Working with portrait and landscape mode programmatically in android -
I want to create a layout for both portrait and landscape mode (in Java) and want to change the orientation programmatically in the Java file I am Can anyone help me?
After the text "itemprop =" text ">
you can force a change in the orientation using the program Use, for more information, see. Edit You can add orientation in your specific As far as the layout is concerned, it is the best suggestion to create different folders under setRequestOrientation (). method of activity class
public class example activity extends {@Override public zero onCreate (bundled savedInstanceState) {super.onCreate (savedInstanceState); SetContentView (R.layout.main); // --- Changing to Landscape mode --- Setified Orientation (Activity Infoda. SCREEN_ORIENTATION_LANDSCAPE); To change to portfolio mode, ActivityInfo. SCREEN_ORIENTATION_PORTRAIT Stable: activity to AndroidManifest.xml Can: & lt; Activity Android: Name = "Demo Activity" Android: label = "@ string / app_name" Android: Screen Orientation = "Portrait" & gt; res / For example, For res / layout-port and res / layout-land for landscape.
Comments
Post a Comment