Android Screen Size Get getScreenPixel(Activity activity)

Here you can find the source of getScreenPixel(Activity activity)

Description

get Screen Pixel

Declaration

public static int[] getScreenPixel(Activity activity) 

Method Source Code

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

import android.util.DisplayMetrics;

public class Main {
    public static int[] getScreenPixel(Activity activity) {
        DisplayMetrics displayMetrics = new DisplayMetrics();
        activity.getWindowManager().getDefaultDisplay()
                .getMetrics(displayMetrics);
        return new int[] { displayMetrics.widthPixels,
                displayMetrics.heightPixels };
    }//from  www .j  a  v  a 2 s  . c om
}

Related

  1. getDisplaySize(Display display)
  2. getDisplayWidth(Context context)
  3. getScreenHeight(Context context)
  4. getScreenHeight(Context context)
  5. getScreenHeight(Display display)
  6. getScreenWidth(Context context)
  7. getScreenWidth(Context context)
  8. getScreenWidth(Display display)
  9. getScreenSizePixels(Context ctx)