Amine116
Amine116

Reputation: 29

Is there any trivial case when `OnclickListener doesn't` work on a activity?

I implemented the interface View.OnclickListener and Override the method onClick. Problem is, all other buttons and view response on click, but a particular button doesn't work.

Java code for that button is:

if(v.getId() == R.id.btnResetPass){
        Log.i("test", "In ResetButton");
        resetPassword();
    }

and xml file code for this button is:

<Button
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/btnResetPass"
    android:text="Reset"/>

Nothing happens when I click on this button. But all other Views and Buttons in this onClick method work properly accept this one. Why isn't it working then?

Upvotes: 1

Views: 37

Answers (1)

Wowo Ot
Wowo Ot

Reputation: 1529

Have you set the Listener

button.setOnClickListener(this);

Upvotes: 1

Related Questions