Android examples for User Interface:Screen Orientation
is Orientation Portrait
//package com.java2s; import android.app.Activity; import android.content.res.Configuration; public class Main { public static boolean isOrientationPortrait(Activity activity) { int orientation = activity.getResources().getConfiguration().orientation; switch (orientation) { case Configuration.ORIENTATION_LANDSCAPE: return false; case Configuration.ORIENTATION_PORTRAIT: return true; }//from www .j a v a2 s . c o m return true; } }