Skip to content Skip to sidebar Skip to footer

Recyclerview Not Displaying

I have a RecyclerView that's not displaying any items. Initially it's empty, but later I add items and call notifyDatasetChanged(). getItemCount() gets called and returns 25, onBin

Solution 1:

I am an idiot.

<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"><includelayout="@layout/toolbar"/><FrameLayoutandroid:id="@+id/content"android:layout_width="match_parent"android:layout_height="match_parent"/></LinearLayout>

The default orientation for LinearLayout is horizontal, and the toolbar's width is match_parent, so my content was off screen. This is probably one of the most popular mistakes on android, which is why you get a warning, but the include must have hidden it.

Post a Comment for "Recyclerview Not Displaying"