I know it’s kinda stupid question, but I couldn’t find an answer : I have started to learn making android application on an internet tutorial. But now I’m blocked, I have 2 EditText that I use to calculate something (it doesn’t matter), my problem is that no text is written when I click any letter on my emulator. I found that the problem is really with this part of code :
private OnKeyListener modificationListener = new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
// Set a defaut text somewhere else, on another EditText
result.setText(defaut);
return true;
}
};
I guessed I was supposed to call the super fonction, but when I try it tells me it’s an error : super.onKey(v, keyCode, event);
Thanks!
Try returning false instead of true.
If you return true your are consuming the event and so it is not there any more for other listeners to act on it.