Example usage for android.app Activity setRequestedOrientation

List of usage examples for android.app Activity setRequestedOrientation

Introduction

In this page you can find the example usage for android.app Activity setRequestedOrientation.

Prototype

public void setRequestedOrientation(@ActivityInfo.ScreenOrientation int requestedOrientation) 

Source Link

Document

Change the desired orientation of this activity.

Usage

From source file:Main.java

public static void setRequestedOrientationLANDSCAPE(Activity act) {
    act.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}

From source file:Main.java

public static void setRequestedOrientationPORTRAIT(Activity act) {
    act.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}

From source file:Main.java

public static final void Window_setOrientationLandscape(Activity act) {
    act.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}

From source file:Main.java

public static void setOrientationUnspecified(Activity context) {
    context.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
}

From source file:Main.java

public static void setOrientationHorizontal(Activity context) {
    context.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}

From source file:Main.java

public static void setOrientationVertical(Activity context) {
    context.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}

From source file:Main.java

public static void setOrientacaoVertical(Activity context) {
    context.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}

From source file:Main.java

public static void UnsetOrientation(Activity context) {
    context.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
}

From source file:Main.java

public static void unlockOrientation(Activity activity) {
    activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
}

From source file:Main.java

public static void unlockScreenOrientation(Activity activity) {
    activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
}