title: KeyBoard : setonkeylistener not working for EditText
body: <p>I am created an app which toast some text when user click on android keyboard's ENTER key but its working on my desktop keyboard means when i click on desktop keyboard's enter key its making toast.<br>
  So what could i do for android keyboard's enter key????</p>
  
  <p>HERE is code:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements View.OnKeyListener{
  
  EditText editText;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      editText=(EditText)findViewById(R.id.editText);
      editText.setOnKeyListener(this);
  }
  
  @Override
  public boolean onKey(View v, int keyCode, KeyEvent event) {
      if(keyCode==KeyEvent.KEYCODE_ENTER){
          Toast.makeText(this,editText.getText().toString()+"Enter Pressed",Toast.LENGTH_LONG).show();
          return true;
      }
      return false;
  }
  </code></pre>
  
  <p>}</p>