Home > Blockchain >  how can ı do Android retrofit 2 recyclerview interface
how can ı do Android retrofit 2 recyclerview interface

Time:07-18

My codes

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 my fail and my fail home fragment page. where is the my fail ?

CodePudding user response:

Instead of this, write something like HomeFragment.this.

I assume that HomeFragment implements IOtobusSaatleriInterface.

  • Related