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=\"?
If you used the implementation correctly, your code should go like this:
card - is the card view you instantiated to display on your ui
card.setOnClickListener(...);
In your implementation of the onClickListener, you should have this:
@Override
public void onClick(Card c ,View v) {
Intent intent = new Intent(MyActivity.this, NextActivity.class);
startActivity(intent);
}
that is pretty much all you need to start a new activity from the card