get Screen Max Point - Android User Interface

Android examples for User Interface:Screen Resolution

Description

get Screen Max Point

Demo Code


//package com.java2s;

import android.content.Context;

import android.graphics.Point;

import android.util.DisplayMetrics;

public class Main {
    public static Point getScreenMaxPoint(Context context) {
        DisplayMetrics displayMetrics = context.getResources()
                .getDisplayMetrics();/*from w w  w . j a  v a2s.  co m*/
        return new Point(displayMetrics.widthPixels,
                displayMetrics.heightPixels);
    }
}

Related Tutorials