I am working in android app, have designed a generic adapter and parameterized adapter will inherit this.
public abstract class CarAdapter<T> extends RecyclerView.Adapter<CarAdapter<T>.BaseCarViewHolder> {
protected DialogMakerCar<T> dialogMaker;
protected Context context;
......
child class
public class CarItemAdapter extends CarDialogAdapter<Item> {
public CarItemAdapter(Context context, DialogMakerCar<Item> dialogMaker) {
super(dialogMaker, context);
}
I am calling this adapter in a fragment and that fragment is also need to be generic so that i can call this fragment and adapter for custom objects from activity.
//Fragment to call adapter but its not letting me to use <T> generic
adapter = new CarItemAdapter(getContext(),dialogMaker);
gridRecycler.setHasFixedSize(true);
gridRecycler.setLayoutManager(adapter.getLayoutManager());
Please let me know if you need more details, Thanks