title: Listen to ENTER key in Android
body: <p>Here is my code:</p>
  
  <pre><code>public class CaptureENTER extends Activity implements OnKeyListener{
  
  /* on create and other stuff in here*/
  
      @Override
      public boolean onKey(View v, int keyCode, KeyEvent event) {
          if ((event.getAction() == KeyEvent.ACTION_DOWN) &amp;&amp;
                  (keyCode == KeyEvent.KEYCODE_ENTER)) {
             Toast.makeText(LiVoiceActivity.this,
                                       "YOU CLICKED ENTER KEY",
                                       Toast.LENGTH_LONG).show();
  
          }       
          return false;
      }
  </code></pre>
  
  <p>I don't know what is going on, but when I press the ENTER key in my keyboard (I am using the Android emulator), <strong>the event is not activated</strong>. </p>
  
  <p>What am I missing?</p>