Newbie here - currently trying to get a button within each card working, and the actions for each click is registering for the first item in the List only.
My adapter is currently working with an ItemClick, that returns the position of which card is being interacted with, but the OnItemClick within the same activity only registers the action within the first card. See below:
public class AP_EM_Activity : Activity
// Loads the Cards
// Layout manager that shows the cards in RecyclerView
// Adapter for access to data
// array list managed by adapter
protected override async void OnCreate(Bundle savedInstanceState)
//Create Menu List
mItemList = new AP_EM_ItemList();
//Set View SetContentView(Resource.Layout.APEditMenu);
//Set up layout manager to view all cards on recycler view
mRecyclerView = FindViewById(Resource.Id.recyclerView);
mLayoutManager = new LinearLayoutManager(this);
//Menu List Adapter
mAdapter = new CVBFItemListAdapter(mItemList);
//Put adapter into RecyclerView
//Card Clicked mAdapter.ItemClick += OnItemClick; }
void OnItemClick(object sender, int position)
modifyi = FindViewById(Resource.Id.btn_cardModify);
modifyi.Click += delegate
Android.Widget.Toast.MakeText(this, "Card clicked.", Android.Widget.ToastLength.Short).Show(); }
What's weird id that the "Card clicked" toast message occurs with every card. I believe it's how I'm using the click, but I'm unsure of where and how to use the setOnClickListener, or whether that would work for cardviews.
Any help is appreciated, thanks guys.