Skip to content Skip to sidebar Skip to footer

Cardview Click Is Not Opening Activty

My problems : no error in this project, i can run successful. my button can click at a certain time. when i click it back, it doesn't work at all. i think my problem is near the

Solution 1:

Well You have to First Remove space from this android:foreground="?android:attr/selectableItemBackground" and add this to all the button

android:clickable="false"

If you want to Open Activity With Button Then you have to put setOnClickListener to Button .Else if you want to open Activity with Cardview you have to put setOnClickListener to cardview.

Use this for OnClick Method:

@Override
    publicvoidonClick(View view){
        if (view==LoginBtn){
 startActivity(newIntent(this,Login1.class));
        }elseif(view==Capture){
startActivity(newIntent(this,Capture.class));

      }
     //Do rest by yourself.

    }

Post a Comment for "Cardview Click Is Not Opening Activty"