Hiding Keyboard on setting turn on or off 
<p>Hello 
I am trying to hide or visible keyboard on turning setting on or off by the following code but it is not working , code for the above is following</p>

<pre><code>if (myPrefs.getString(GlobalConfig.IsShowKeyboard, "")
                .equalsIgnoreCase("true")) {
        InputMethodManager inputMgr = (InputMethodManager) getSystemService(DialActivity.INPUT_METHOD_SERVICE);
        inputMgr.toggleSoftInput(1, 0);

        }
        else{
    {InputMethodManager inputMgr = (InputMethodManager) getSystemService(DialActivity.INPUT_METHOD_SERVICE);
        inputMgr.toggleSoftInput(0, 1);

        }
</code></pre>

<p>where myPrefs is the object of SharedPreferences. Please suggest me what i am doing  wrong.
Help me.
Thanks.</p>
