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

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());
posted @ 2015-08-20 15:40  wanqi  阅读(871)  评论(0编辑  收藏  举报