• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

app starting issue

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:
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) {
so if anyone has a solution, please help
 
Last edited by a moderator:

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones