I used a callback methods I was guided to use in a previous question. It doesn\'t seem to work. The onClick() method is not called. callback methods seem to be a very broad conc
You don't need to pass view and position, just pass the object you want.
Change your interface parameter
public interface ItemClickListener {
void onItemClick(Country country);
}
and you can pass the object you need
public void onClick(View view) {
final Country currentCountry = countriesList.get(getAdapterPosition());
mClickListener.onItemClick(currentCountry);
}
In your Activity, get your Country
@Override
public void onItemClick(Country country) {
// get country and do anything you want
}
Hope this helps