What is wrong with the way I try to get the window height of Android keyboard
<pre><code>import android.util.DisplayMetrics;
import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
</code></pre>

<p>...</p>

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

<p>The error is</p>

<pre><code>compile:
    [javac] Compiling 2 source files to /Users/billy/SoftKeyboard/bin/classes
    [javac] /Users/billy/SoftKeyboard/src/com/example/android/softkeyboard/SoftKeyboard.java:153: cannot find symbol
    [javac] symbol  : method getWindowManager()
    [javac] location: class com.example.android.softkeyboard.SoftKeyboard
    [javac]         getWindowManager().getDefaultDisplay().getMetrics(metrics);
    [javac]         ^
    [javac] 1 error
</code></pre>
