Why am I receiving an error when trying to use DisplayMetrics in Android?
<p>I'm just starting with Android programming, and I receive an error in the following code:</p>

<pre><code>DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
</code></pre>

<p>The first line is fine according to Eclipse.  But in the second line it's telling me that "getWindowManager"'s return type is missing.  I don't understand this.  When I search the internet on how to use this code, everyone is doing the same thing.  Yet Eclipse is giving me an error.</p>
