Cause for NullPointerException android.support.v7.widget.RecyclerView.onMeasure

时间:2021-12-09 16:47:40

because you have not set LinearLayoutManager to RecyclerView.

for example:

    mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);
LinearLayoutManager layoutManager = new LinearLayoutManager(context);
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.setAdapter(new CustomAdapter());