title: hideSoftInputFromWindow throws NoSuchMethodError
body: <p>I have code in Java that hides the soft keyboard using the InputMethodManager. When I convert the code to Kotlin, the same code throws a NoMethodFound exception.</p>
  
  <p>I can easily switch between the Java and Kotlin versions and demonstrate the correct behaviour in Java and incorrect behaviour in Kotlin.</p>
  
  <p>Java code</p>
  
  <pre class="lang-java prettyprint-override"><code>            searchText.clearFocus();
              InputMethodManager imm = (InputMethodManager)dialog.getContext().getSystemService(Activity.INPUT_METHOD_SERVICE);
              try {
                  imm.hideSoftInputFromWindow(searchText.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
              } catch (Throwable t) {
                  String stop = "here";
              }
  </code></pre>
  
  <p>Kotlin code</p>
  
  <pre><code>            searchText!!.clearFocus()
              val imm = dialog!!.context.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
              try {
                  imm.hideSoftInputFromWindow(searchText!!.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
              } catch (t: Throwable) {
                  val stop = "here"
              }
  </code></pre>
  
  <p>The Java code exhibits the correct behaviour and dismisses the soft keyboard.
  The Kotlin code throws the exception </p>
  
  <blockquote>
    <p>"java.lang.NoSuchMethodError: No virtual method
    hideSoftInputFromWindow(Landroid/os/IBinder;I)V in class
    Landroid/view/inputmethod/InputMethodManager; or its super classes
    (declaration of 'android.view.inputmethod.InputMethodManager' appears
    in /system/framework/framework.jar:classes2.dex)"</p>
  </blockquote>