user2946171
user2946171

Reputation: 5

google api v2 get width and height

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

Answers (1)

Quentin Klein
Quentin Klein

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

Related Questions