So i have a small problem, i\'m writing a function which need to send screen width to server. I got it all to work, and i use:
Display display = getWindowMan
May be this approach will be helpful:
DisplayMetrics displaymetrics = new DisplayMetrics(); mContext.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); int screenWidth = displaymetrics.widthPixels; int screenHeight = displaymetrics.heightPixels;