get Display Screen Size - Android android.app

Android examples for android.app:Screen

Description

get Display Screen Size

Demo Code

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  .  ja va  2s.  c o m

        return size;
    }

}

Related Tutorials