event.key javascript in android code example
Example: android done key event
import android.view.inputmethod.EditorInfo;
import android.widget.TextView;
Context context = this;
TextView.OnEditorActionListener editListener = new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_NEXT) {
Toast.makeText(context, "next", Toast.LENGTH_SHORT).show();
}
if (actionId == EditorInfo.IME_ACTION_DONE) {
Toast.makeText(context, "done", Toast.LENGTH_SHORT).show();
}
return false;
}
};
nameEdit.setOnEditorActionListener(editListener);