Java tutorial
//package com.java2s; import android.app.Activity; import android.content.pm.ActivityInfo; public class Main { public static void setOrientationVertical(Activity context) { context.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } }