Recyclerview not call any Adapter method :onCreateViewHolder,onBindViewHolder,

If RecyclerView gets put into a ScrollView, then during measure step its height is unspecified (because ScrollView allows any height) and gets equal to minimum height (as per implementation) which is apparently zero.

ref : android: RecyclerView inside a ScrollView

Solution : - put views in row of RecyclerViews - Calculate the size of the list items and set the height of the ListView programmatically http://vardhan-justlikethat.blogspot.com/2014/04/android-listview-inside-scrollview.html


Other than @SanatiSharif's and @sohrab's answer, you have to follow below mandatory step.

Make sure you call setLayoutManager, something like below.

recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));

before setting adapter into recyclerView, otherwise it is not going to work. You can customize it if you need. this link will give you some idea of how LayoutManager works.


As @yigit guess the combination of ScrollView, RelativeLayout causes this problem, Just make more room for RecyclerView.


Might have been a different case but for me I just forgot to set the Layout Manager as follows:

LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
recycler.setLayoutManager(layoutManager);

Hope it helps :)