public static int getScreenHeight(Activity context) {
Display display = context.getWindowManager().getDefaultDisplay();
DisplayMetrics dm = new DisplayMetrics();
display.getRealMetrics(dm);
return dm.heightPixels;
}
public static int getScreenWidth(Activity context) {
Display display = context.getWindowManager().getDefaultDisplay();
DisplayMetrics dm = new DisplayMetrics();
display.getRealMetrics(dm);
return dm.widthPixels;
}