Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import android.content.Context;
import android.content.res.Configuration;

public class Main {
    /**
     * Determines whether or not the device has an extra large screen.
     *
     * @param context The Android context.
     * @return boolean value indicating if the screen size is extra large.
     */
    public static boolean isExtraLargeScreen(Context context) {
        int screenSizeMask = context.getResources().getConfiguration().screenLayout
                & Configuration.SCREENLAYOUT_SIZE_MASK;
        if (screenSizeMask == Configuration.SCREENLAYOUT_SIZE_XLARGE) {
            return true;
        } else {
            return false;
        }
    }
}