How to Create Expandable List With RecyclerView in Android

In this android programming source code example, we are going to explore how to create expandable list with RecyclerView in android. Below is a step by step source code on how to create expandable list with RecyclerView in android. activity_main.xml <?xml version=”1.0″ encoding=”utf-8″?> <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”match_parent”> <android.support.v7.widget.RecyclerView android:id=”@+id/list” android:layout_width=”match_parent” android:layout_height=”match_parent”/> </RelativeLayout> MainActivity.java import android.content.Context; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class RecyclerViewActivity12 extends AppCompatActivity { private RecyclerView list; private adapter … Continue reading How to Create Expandable List With RecyclerView in Android