Android Screen Size Get getScreenSize(Activity act)

Here you can find the source of getScreenSize(Activity act)

Description

get Screen Size

Declaration

public static int[] getScreenSize(Activity act) 

Method Source Code

//package com.java2s;

import android.app.Activity;

import android.graphics.Point;

import android.view.Display;

public class Main {
    public static int[] getScreenSize(Activity act) {
        Display display = act.getWindowManager().getDefaultDisplay();
        Point size = new Point();
        int[] dimensions = new int[2];
        display.getSize(size);/*from  w w w .  j  a va2 s  .  com*/
        dimensions[0] = size.x;
        dimensions[1] = size.y;
        return dimensions;
    }
}

Related

  1. getScreenWidth(Context context)
  2. getStatusHeight(Context context)
  3. getScreenSize(@Nonnull Context context)
  4. getScreenHeight(Context context)
  5. getScreenWidth(Context context)
  6. getDeviceDesity(Activity activity)
  7. getDeviceResolution(Activity activity)