Rod_Algonquin Rod_Algonquin - 6 days ago 6
Android Question

CoordinatorLayout using the ViewPager's RecyclerView

I am using the view

CoordinatorLayout
from
android.support.design
. I want to attach the
app:layout_behavior
to the fragment's
RecyclerView
?

In the example given by Google, they only attach it in the
RecyclerView
of the same XML file where the
CoordinatorLayout
was attached.

Is there a way to attach
CoordinatorLayout
to the fragment's
RecyclerView
within the
ViewPager
?

The sample is in this blog post at Android Developers blog.

Answer

This might be dumb, but it didn't worked due to the fact that the build tool was not updated in the build.gradle of the application version to 22, I was using 21 that is why it is not working as expected to be.

Edit:

Also what SanderTuit said: adding com.android.support:recyclerview-v7:22.2.0 will also solve the problem

Comments