DisplayMetrics metrics=new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int widthPixels=metrics.widthPixels;
int heightPixels=metrics.heightPixels;
DisplayMetrics metrics=new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int widthPixels=metrics.widthPixels;
int heightPixels=metrics.heightPixels;