Sectioned RecyclerView Android

Sectioned RecyclerView Android

Hi all, Today we are going to learn how to make Sectioned RecyclerView which you have seen in PlayStore App. To know about RecyclerView and basic implementations you can see my previous articles on it.

To make Sectioned RecyclerView we are going to need a RecyclerView nested into another RecyclerView.


1. Create a new project in Android Studio by navigating to File ⇒ New Android ⇒ Application Project and fill required details. By default my activity is

2. Open res ⇒ values ⇒ strings.xml and add below string values. These are some strings that we are going to use in our project.

3. Now go to activity_main.xml and add the below code to it. In this layout we are using three Button to show different types of Sectioned RecyclerView.

4. After adding three Button lets implement click event on them and open on Button click. For this add the below code to your

5. For create new xml layout naming recycler_view_activity.xml and add RecyclerView to it.

6. After creating recycler_view_activity.xml create class and put the below code to it. In this class we are populating RecyclerView with Sections and Items using pojo class.

Vertical Sectioned RecyclerView

Vertical Sectioned RecyclerView

Horizontal Sectioned RecyclerView

Horizontal Sectioned RecyclerView

Grid Sectioned RecyclerView

Grid Sectioned RecyclerView

7. To identify the type of Sectioned RecyclerView we will create an ENUM java class naming and add the three enums to it.

8. Now create pojo class naming for RecyclerView.

9. Now lets create adapter class for RecyclerView naming and put the below code to it. In this class we are setting different LayoutManager on basis of enum type inside onBindViewHolder method.

10. For RecyclerView sections we are going to create xml layout naming section_custom_row_layout.xml. This layout contains one section label, one show all button and one RecyclerView for displaying Section Items.

11. To display section items we need to create one more adapter for Items naming and put the below code to it.

12. For items adapter we need to create an xml layout naming item_custom_row_layout.xml. In this layout we are taking a CardView with ImageView and TextView.

13. Finally all done, now you can also make Sectioned RecyclerView.

Thanks. :)

Download Source Code


About the author

I am an Android developer for whom Android is the one and only love. I work as a freelancer which gets me and Android closer. I always love to share my learnings and love to learn from others knowledge too.


When I test with inner recyclerview item with 20, scroll not work well.Try to test and change inner recyclerview with many items

    Hi Htoo Aung Hlaing,

    Do one thing use below code for both RecyclerView :


    Use this with both recyclerview and check.



notifydatasetchanged does not work in this example, how can i make it work?


    Hi Pedro

    Can you tell me what code you are using to notify adapter?



How can I update a single row in the sectioned recycler view?

    Hi Snomen,

    To update single row item in Sectioned Recycler View you need to update that item pojo class and after that you have to notify its adapter.



From ItemRecyclerViewAdapter, on clicking a row I’m starting a new Activity. After putting in few values in the activity I’m passing an object back to RecyclerViewActivity in onActivityResult()

if (resultCode == RESULT_OK) {
Person person = data.getParcelableExtra(“person”);
How can I pass this object so that only the clicked row is updated?


Nice tutorial.. Keep it up bud 🙂

Leave a Comment

Comment (required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Name (required)
Email (required)