Use

Display display = getWindowManager().getDefaultDisplay();

Then do

                int height = display.getHeight();
                int weight = display.getWidth();

Now you wont be able to assign these as static, as if you try to get
the width and height outside the onCreate method, and then run program
it will crash. Although I am not sure why you would need to assign the
width and height as a static variable. I suppose one way to get around
this would have a class with a static height and width variable and in
your main class where you declare the onCreate method, use Window
Manager, get width and height, then pass the variables from there into
the static variables in the other class.
On Nov 26, 12:43 pm, Darshan Santoki <[email protected]>
wrote:
> I am new in developing.
> I want display width and height and assign it static integer.
> If this possible than how?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to