Reputation: 5
I'm trying to get width and height from a map fragment. However methods getWidth and getHeight are deprecated and i dont now how to do in google v2.
I used to do like this way:
display = getWindowManager().getDefaultDisplay();
width = display.getWidth();
height = display.getHeight();
Please someone help
Upvotes: 0
Views: 1640
Reputation: 1393
If I understand, you're trying to get screen dimensions, maybe you should look at this post:
if you want the the display dimensions in pixels you can use getSize:
Display display = getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size); int width = size.x; int height = size.y;
See this post for details How to get screen dimensions as pixels in Android.
Upvotes: 1