So I\'ve been taking a shot at the Material Design of Android Preview L. I imported both the CardView
and the RecyclerView
libraries.
I use the
I am using Eclipse and faced the same issue. As suggested by user7610, you need to call recyclerView.setLayoutManager()
to get over this.
Here is how i solved it..
Create a member variable..
RecyclerView.LayoutManager mLayoutManager;
In onCreate()
or onCreateView()
recyclerView = (RecyclerView) view
.findViewById(R.id.business_recycler_view);
recyclerView.setHasFixedSize(true);
mLayoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(mLayoutManager);
This solved my NullPointerException
.