0

I use OnKeyListener for detect input character but I want to detect ':' character, my code is:

etStartingFrom.setOnKeyListener(new View.OnKeyListener(){

public boolean onKey(View arg0, int key, KeyEvent arg2){

    //how detect ':'


    return false;
}
});
Arshad Ali
  • 3,082
  • 12
  • 56
  • 99
aeRogelio
  • 37
  • 1
  • 10
  • Your question is unclear and seems to be answered, check here http://stackoverflow.com/questions/4451374/use-enter-key-on-softkeyboard-instead-of-clicking-button/4451825#4451825 – Bassel Serio May 13 '14 at 02:34
  • possible duplicate of [Android: How can I validate EditText input?](http://stackoverflow.com/questions/2763022/android-how-can-i-validate-edittext-input) – Howli May 21 '14 at 15:03

1 Answers1

0

You are getting keyEvent Listener and you can detect it here.

public boolean onKey(View arg0, int key, KeyEvent arg2){

//how detect ':'

 if(keycode==KeyEvent.KEYCODE_SEMICOLON){
               if(event.isShiftPressed ())
                doYourTaskHere();
                return true;
 }
}
Pradeep Kumar
  • 777
  • 6
  • 21