Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    /**
     * Determining the current screen's size related to Large, XLarge or not.
     * 
     * @param context
     *            The Application Context.
     * @return boolean Type
     */
    public static boolean isLargeOrXLarge(Context context) {
        int mask = (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK);
        return (mask == Configuration.SCREENLAYOUT_SIZE_XLARGE) || (mask == Configuration.SCREENLAYOUT_SIZE_LARGE);
    }
}