@SuppressLint("NewApi")
private int
getScreenWidth() {
int iMeasuredwidth
= 0;
Point
size = new Point();
WindowManager
w = getWindowManager();
if(Build.VERSION.SDK_INT >=
Build.VERSION_CODES.HONEYCOMB_MR2){
w.getDefaultDisplay().getSize(size);
iMeasuredwidth
= size.x;
}else{
Display
d = w.getDefaultDisplay();
iMeasuredwidth
= d.getWidth();
}
return iMeasuredwidth;
}
No comments:
Post a Comment