title: Android - Hide keyboard on Android 8
body: <p>I'm having troubles with hiding the keyboard on Android 8.
  I used this before and it worked for the older androids: </p>
  
  <pre><code>    val view = activity.currentFocus
      if (view != null) {
          val imm = activity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
          imm.hideSoftInputFromWindow(view.windowToken, 0)
      }
  </code></pre>
  
  <p>Android 8 just ignores it and shows the keyboard anyway.
  Probably making the input field unfocusable would help, but I really need it to be focusable, so this is not an option.</p>