Returns true for all screens with dpi higher than android.util.DisplayMetrics#DENSITY_HIGH . - Android User Interface

Android examples for User Interface:Screen Size

Description

Returns true for all screens with dpi higher than android.util.DisplayMetrics#DENSITY_HIGH .

Demo Code


//package com.java2s;
import android.content.Context;
import android.util.DisplayMetrics;

public class Main {
    /**/*from ww  w.  j  a va2  s . c om*/
     * Returns true for all screens with dpi higher than {@link android.util.DisplayMetrics#DENSITY_HIGH}.
     */
    public static boolean isVeryHighDensityScreen(Context context) {
        return context.getResources().getDisplayMetrics().densityDpi > DisplayMetrics.DENSITY_HIGH;
    }
}

Related Tutorials