Java tutorial
//package com.java2s; import android.content.pm.ActivityInfo; import java.lang.reflect.Field; public class Main { public static int getScreenOrieLockedValue(Class<ActivityInfo> object) { int value = -1; try { Field field = object.getField("SCREEN_ORIENTATION_LOCKED"); value = field.getInt(object); } catch (Exception e) { e.printStackTrace(); } return value; } }