is Screen Orientation Portrait - Android User Interface

Android examples for User Interface:Screen Orientation

Description

is Screen Orientation Portrait

Demo Code


//package com.java2s;
import android.content.Context;
import android.content.res.Configuration;

public class Main {

    public static boolean isScreenOrientationPortrait(Context context) {
        return context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;

    }/* w  w  w .  j  a  v  a  2s . c om*/
}

Related Tutorials