title: Clear edittext focus and hide keyboard when button is pressed
body: <p>I'm making an app with edittext and a button. When I enter something into edittext and then click a button, I want the keyboard and focus on edittext to disappear but I can't seem to do it.</p>
  
  <p>I inserted these 2 lines of code in XML:</p>
  
  <pre><code>android:focusable="true"
  android:focusableInTouchMode="true"
  </code></pre>
  
  <p>I also tried to add this in the button click method:</p>
  
  <pre><code>edittext.clearFocus();
  this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
  </code></pre>
  
  <p>And it just won't work, after I press the button, the keyboard remains there and edittext still has focus.</p>