Android Context Check isLandscape(Context context)

Here you can find the source of isLandscape(Context context)

Description

is Landscape

Declaration

public static synchronized boolean isLandscape(Context context) 

Method Source Code

//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;
        }
    }
}

Related

  1. isGPRSAvailable(Context context)
  2. isGoogleAccountPresent(Context ctx)
  3. isGpsEnabled(Context context)
  4. isHeadsetPluggedIn(Context context)
  5. isInstalledThroughPlayStore(final Context context)
  6. isLandscape(final Context context)
  7. isLocationEnabledGPS(Context c)
  8. isMobile(Context context)
  9. isMobilityInstalled(Context context)