How to show an empty view with a RecyclerView?

On the same layout where is defined the RecyclerView, add the TextView: <android.support.v7.widget.RecyclerView android:id=”@+id/recycler_view” android:layout_width=”match_parent” android:layout_height=”match_parent” android:scrollbars=”vertical” /> <TextView android:id=”@+id/empty_view” android:layout_width=”match_parent” android:layout_height=”match_parent” android:gravity=”center” android:visibility=”gone” android:text=”@string/no_data_available” /> At the onCreate or the appropriate callback you check if the dataset that feeds your RecyclerView is empty. If the dataset is empty, the RecyclerView is empty too. In … Read more