Get width and height of display assign it to static integer
<p>I am new to android developing please help me in this problem.</p>

<pre><code>static Display display=((WindowManager)context
       .getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();  
static int height=display.getHeight();  
static int width=display.getWidth();
</code></pre>

<p>This shows error so give me solution.</p>

<blockquote>
  <p>11-26 17:40:17.806: ERROR/AndroidRuntime(422):
  java.lang.ExceptionInInitializerError</p>
</blockquote>
