Reputation: 561
I am developing a chat app for android. I am trying to implement a typing feature so that the chat partner know if the other site is typing.
For this i need to get notified when the smartphone user is typing on the soft keyboard. Is there a some listener to keyboard touch events?
Upvotes: 0
Views: 1251
Reputation:
editText.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// TODO Auto-generated method stub
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
status = "Typing"; // where status is a string you send to the other person
}
});
Upvotes: 4