I am new to Android programming and was working on a card layout. I was wondering, how do I make it clickable?
android:clickable=\"true\" android:foreground=\"?
Addind onClick to the cardView did it for me:
Then call it in your java function as below:
public void P1_bay(View view) { Toast.makeText(this, "You have clicked P1", Toast.LENGTH_LONG).show(); }