title: Android: onKeyListener simulating two instances of a pressed key
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3802887/public-boolean-onkey-called-twice">public boolean onKey() called twice?</a>  </p>
  </blockquote>
  
  
  
  <pre><code>Display.setOnKeyListener(new OnKeyListener() {
      public boolean onKey(View v, int keyCode, KeyEvent event) {
          switch (keyCode) {
               case KeyEvent.KEYCODE_ENTER:
                  solveExpression();
                  return true;
          }
          return false;
      }
  });
  </code></pre>
  
  <p>I'm trying to solve the expression contained within the Display(EditText), by pressing the enter button on the keyboard, yet it always interprets it as though I pressed the button twice.  Does anyone know why this happens?</p>