public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { RecyclerViewNewHolder viewHolder = holder as RecyclerViewNewHolder; viewHolder.name.Text = restaurants[position].name; viewHolder.cuisine.Text = restaurants[position].phone; viewHolder.location.Text = restaurants[position].address; viewHolder.buttonAdd.Click += (sender, e) => { var password = API.AcceptRestaurant(restaurants[position].idrestaurant); if (password.Length == 5) { Intent intent = new Intent(context, typeof(ActivityAddRestaurant)); intent.PutExtra("password", password); intent.PutExtra("JSONRes", JsonConvert.SerializeObject(restaurants[position])); context.StartActivity(intent); restaurants.RemoveAt(position); NotifyDataSetChanged(); NotifyItemChanged(position); } }; viewHolder.buttonDeny.Click += (sender, e) => { if (API.DenyRestaurant(restaurants[position].idrestaurant)) { restaurants.RemoveAt(position); NotifyDataSetChanged(); NotifyItemChanged(position); } }; }