is Screen Landscape Orientation - Android Phone

Android examples for Phone:Screen

Description

is Screen 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 av  a 2  s. com*/
}

Related Tutorials