66.13 Initializing the RecyclerView
Add the final setup method to initialize and configure the RecyclerView and adapter as follows:
.
.
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
.
.
private void recyclerSetup() {
RecyclerView recyclerView;
adapter = new ProductListAdapter(R.layout.product_list_item);
recyclerView = getView().findViewById(R.id.product_recycler);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(adapter);
}
.
.
}