How to hide virtual keyboard in android
<p>i used this code</p>

<pre><code>InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
 imm.hideSoftInputFromWindow(EditView.getWindowToken(), 0);
</code></pre>

<p>this code works fine in a class which extends Activity</p>

<p>but i need to hide virtual keyboard in a class which extends LinearLayout.</p>
