hello everyone. so my issue is the following: i try to create a quizz following a tutorial, but my function meant to detect a typing on the emulator and make a button reappear make my application crash continuously, thus making it impossible to start, here is the code:
so if anyone has a solution, please help
Code:
mFamilyName = findViewById(R.id.text2);// permet de lier la balise concernée dans le XML
mButtonSubmit.setEnabled(false);//désactive le bouton par défaut
mFamilyName.addTextChangedListener(new TextWatcher() {
[USER=1021285]@override[/USER]
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
[USER=1021285]@override[/USER]
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
[USER=1021285]@override[/USER]
public void afterTextChanged(Editable editable) {
mButtonSubmit.setEnabled(!editable.toString().isEmpty());
}
});
mButtonSubmit.setOnClickListener(new View.OnClickListener() {
[USER=1021285]@override[/USER]
public void onClick(View view) {
Last edited by a moderator: