title: How to use the key event of Android emulator keyboard?
body: <p>I make simple maths app (Calculater).Like Addition Subtraction etc.
  So I take three Editview two for question and one for Answer. I use the <code>longKeyPressed</code> event and get the Result when user press the enter key of Android emulator. For this I use the keycode of entet key and apply in the longKeyPressesd method but no solution.
  My code is</p>
  
  <pre><code>@Override
  public boolean onKeyLongPress(int keyCode, KeyEvent event) 
  {
      switch (keyCode) 
      {
      case KeyEvent.KEYCODE_ENTER:
          if(!(txtAnswer.getText().toString().equals(" ")))
          {
              checkAnswer(Integer.parseInt(txtAnswer.getText().toString()),correctOption);
          }else
          {
              genHelper.showToast("Another evenet ::-&gt;"+event.getKeyCode());          
  
          }
          break;
  
      default:
          genHelper.showToast("Default key Pressed:-&gt;&gt;-&gt;"+event.getKeyCode());
          break;
      }
      return super.onKeyLongPress(keyCode, event);
  }
  </code></pre>
  
  <p>genHelper is my Genral class for use reuseability purpose.</p>
  
  <p>Now Today I use <code>OnEditorActionListener</code> for find the result but the keycode emulator kaypad</p>
  
  <p>My New Code is below</p>
  
  <pre><code>txtOnes.setOnEditorActionListener(new OnEditorActionListener() 
                  {   
                      public boolean onEditorAction(TextView v, int actionId, KeyEvent event) 
                      {
  
                          if (event != null&amp;&amp; (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) 
                           {
                               genHelper.showToast("Key Code--&gt;"+event.getKeyCode());
                               genHelper.showToast("System Key Code--&gt;"+KeyEvent.KEYCODE_ENTER);
                               if(txtTens.getText().toString().equals(""))
                                  {               
                                      forTens=0;
                                  }
                                  else
                                  {
                                      forTens=Integer.parseInt(txtTens.getText().toString());
                                  }                           
                                  forOnes=Integer.parseInt(txtOnes.getText().toString());
                                  forOnes=forOnes+forTens;
                                  txtAnswer.setText(String.valueOf(forOnes));
  
                               return true;
                           }else
                           {
                               genHelper.showErrorLog("Else part here ones");
                           }
                          return false;
                      }
                  });
  </code></pre>