giving null pointer when using InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
<p>Hi I'm trying to input this piece of code to hide the soft keyboard on the android, but it's returning a null pointer.</p>

<p>code:</p>

<pre><code>public void testSetTestEnvironment (){
    solo.clickInList(4);
    solo.clickOnMenuItem(ConfigVariables.CATALOGSERVER);
    assertTrue(solo.searchText(ConfigVariables.CATALOGSERVERURL));


    //Enter KeyCode
     solo.clickInList(5);

    View myEditText = solo.getViews().get(0);
    InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(myEditText.getWindowToken(), InputMethodManager.HIDE_IMPLICIT_ONLY);

    solo.enterText(solo.getEditText(0), "");
    solo.enterText(0, ConfigVariables.KEYCODE);

    assertTrue(popupClickButtonHandler("Enter KeyCode", "OK"));
</code></pre>

<p>the logs show:</p>

<p>java.lang.NullPointerException</p>

<p>Thanks.</p>
