Saturday, 16 November 2013

error adding setOnKeyListener in android

myEditText.setOnKeyListener(new OnKeyListener() {
    public boolean onKey(View v, int keyCode, KeyEvent event) {
Above code in android gets compiling error because it uses View's V so 
replace with below code
 myEditText.setOnKeyListener(new View.OnKeyListener() {
  public boolean onKey(View v, int keyCode, KeyEvent event) {