is Landscape Orientation - Android User Interface

Android examples for User Interface:Screen Orientation

Description

is Landscape Orientation

Demo Code


//package com.java2s;

import android.content.Context;

import android.view.Surface;

public class Main {
    public static boolean isLandscapeOrientation(Context context) {
        return context.getResources().getConfiguration().orientation == Surface.ROTATION_0
                || context.getResources().getConfiguration().orientation == Surface.ROTATION_180;
    }/*from w  ww. j ava  2  s . c o  m*/
}

Related Tutorials