Here you can find the source of isLandscape(Context context)
public static synchronized boolean isLandscape(Context context)
//package com.java2s; import android.content.Context; import android.view.Display; import android.view.WindowManager; public class Main { public static synchronized boolean isLandscape(Context context) { Display display = ((WindowManager) context .getSystemService(Context.WINDOW_SERVICE)) .getDefaultDisplay();//from w w w . j av a 2 s . c o m if (display.getWidth() > display.getHeight()) { return true; } else { return false; } } }