i'm new to Android development. I'm building an app that has cardviews inside a recyclerview. I want to make a single-choice alertdialog list and also handle them. I'm using FirebaseUI library to populate recyclerview.
Here is my ViewHolder class:
public class FriendListViewHolder extends RecyclerView.ViewHolder{
public CircleImageView friendPhoto;
public TextView friendName;
public CardView friendsCardView;
public FriendListViewHolder(@NonNull final View itemView) {
super(itemView);
friendPhoto = itemView.findViewById(R.id.friendProfilePhoto);
friendName = itemView.findViewById(R.id.friendNameText);
friendsCardView = itemView.findViewById(R.id.friends_cardview);
}
}
Whenever user clicks on a cardview, alerdialog will pop-up. But keep in mind, i need to know which carview was selected.