I'm sorry if the question already exist, but I didn't know what to look for. I just need ideas for a solution. so my problem is that I need to get different activities when I click cardview on recyclerview, but my cardview onclicklistener existing on my adapter and I don't know if or how i can check if the user is logged in.
i'll add my onclicklistener from my adapter.
@Override
public void onClick(View view) {
Intent intent = new Intent(mContext, DetailActivity.class);
intent.putExtra("Image", myFoodList.get(holder.getAdapterPosition()).getItemImage());
intent.putExtra("Description", myFoodList.get(holder.getAdapterPosition()).getItemDescription());
intent.putExtra("keyValue",myFoodList.get(holder.getAdapterPosition()).getKey());
mContext.startActivity(intent);
}
});```
thank you for your help