title: Setting EditText to single line makes it lose its focus after pressing enter
body: <p>I use an EditText in my code and compare its content to a string when clicking on a button.
  Unfortunately doing this with the enter key through onKey causes problems because enter creates a
  line break.
  I used:</p>
  
  <pre><code>setSingleLine(true);
  </code></pre>
  
  <p>to prevent this. But now pressing enter leads to the EditText losing its focus.
  Why does it behave like this and how do I fix it?</p>