get Display Screen Size - Android User Interface

Android examples for User Interface:Screen Size

Description

get Display Screen Size

Demo Code


//package com.java2s;
import android.app.Activity;
import android.graphics.Point;
import android.view.Display;

public class Main {
    public static Point getDisplayScreenSize(Activity activity) {
        Display display = activity.getWindowManager().getDefaultDisplay();
        Point size = new Point();
        display.getSize(size);//  w w w.j a  va2s .c om

        return size;
    }
}

Related Tutorials