How to open new Activity by clicking [cardview] I am beginner and i have no idea of using [CardView] as a button. Help me i need example code
I hope you added CardView
in xml
CardView cardView=findViewById(R.id.cardView);
cardView.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
Intent intent=new Intent(getApplicationContext(),YourActivityName.class);
startActivtiy(intent);
}
});
add above code in your onCreate
method