get Display Size and return a Point - Android User Interface

Android examples for User Interface:Display

Description

get Display Size and return a Point

Demo Code


//package com.java2s;
import android.app.Activity;

import android.graphics.Point;
import android.view.Display;

public class Main {
    public static Point getDisplaySize(Activity activity) {
        Display display = activity.getWindowManager().getDefaultDisplay();
        final Point size = new Point();
        display.getSize(size);// w  w w.jav a  2  s.c  om
        return size;
    }
}

Related Tutorials