Here is my code.
My adapter:
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.myviewholder> { List<ResponseModel> data; private final IOtobusSaatleriInterface iOtobusSaatleriInterface; public MyAdapter(List<ResponseModel> data, IOtobusSaatleriInterface iOtobusSaatleriInterface) { this.data = data; this.iOtobusSaatleriInterface = iOtobusSaatleriInterface; } }
And my interface:
public interface IOtobusSaatleriInterface { void onItemClick(int position); }
This is where I am failing. Here is my failing home fragment page. Where is the problem?
Advertisement
Answer
Instead of this, write something like HomeFragment.this.
I assume that HomeFragment implements IOtobusSaatleriInterface.