Java – RecyclerView does not have an adapter provisioned

RecyclerView does not have an adapter provisioned… here is a solution to the problem.

RecyclerView does not have an adapter provisioned

I have three Recycle Bin Views in one fragment. I’ve set up adapters for two of them. However, one recycler View will exaggerate the card View, while the other will not.

I debugged the code and the recycler that doesn’t show the View adapter isn’t called.

This is my onViewCreated() method in the fragment

public void onViewCreated(View view, @NonNull Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

recyclerViewVendors = view.findViewById(;
        recyclerViewEvents = view.findViewById(;
        String json;

InputStream is = getActivity().getAssets().open("vendorServices.json");
            int size = is.available();
            byte[] buffer = new byte[size];
            if( == -1){
                throw new EOFException();
            json = new String(buffer, StandardCharsets.UTF_8);

JSONObject object = new JSONObject(json);
            JSONArray j_Array = object.getJSONArray("vendorServices");

for(int i=0; i<j_Array.length(); i++){
                JSONObject jo_inside = j_Array.getJSONObject(i);
                myDatasetVendors.add(new VendorService(

is = getActivity().getAssets().open("activities.json");
            size = is.available();
            buffer = new byte[size];
            if ( == -1) {
                throw new EOFException();

            json = new String(buffer, StandardCharsets.UTF_8);

JSONObject obj = new JSONObject(json);
            JSONArray m_jArray = obj.getJSONArray("Activities");

for (int i = 0; i < m_jArray.length(); i++) {
                JSONObject jo_inside = m_jArray.getJSONObject(i);

} catch (IOException e) {
        } catch (JSONException e) {

layoutManagerVendors = new LinearLayoutManager(this.getContext(), LinearLayoutManager.HORIZONTAL, false);

mAdapterVendors = new AdapterVendorServices(myDatasetVendors, this.getContext());

layoutManagerEvents = new LinearLayoutManager(this.getContext(), LinearLayoutManager.HORIZONTAL, false);

mAdapterEvents = new AdapterHomeEvents(myDatasetEvents, this.getContext());

This is my adapter and it is not called

public class AdapterHomeEvents extends RecyclerView.Adapter<AdapterHomeEvents.MyViewHolder> {
    ArrayList<String> mDataset;
    Context context;

public AdapterHomeEvents(ArrayList<String> mDataset, Context context) {
        this.mDataset = mDataset;
        this.context = context;

    public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View v = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.card_view_home_events, parent, false);
        MyViewHolder vh = new MyViewHolder(v);
        return vh;

    public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {

    public int getItemCount() {
        return mDataset.size();

static class MyViewHolder extends RecyclerView.ViewHolder {
        TextView textView;

MyViewHolder(View itemView) {
            textView = itemView.findViewById(;

I want it to populate my two recycle Views with the card View, but it only populates one Recycler View and not the other.

Related Problems and Solutions