Skip to content Skip to sidebar Skip to footer

E/recyclerview﹕ No Adapter Attached; Skipping Layout

By the title of this question, its easily understandable that, the adapter of recyclerview is not set inside a UI thread. But in my case to avoid that I have tried doing it even on

Solution 1:

You need to attach your adapter when you initialize your RecyclerView and attach LayoutManager, etc.

loadFriends method should fetch data and add data to the adapter and then you should call notifyDataSetChanged or equivalent.

What you're doing here is incorrect. A recyclerview should always have an adapter attached. You just need to update the data in the adapter.

And that's what the error says E/RecyclerView﹕ No adapter attached; skipping layout. Because you have not attached adapter after attaching LayoutManager and you're attaching adapter at a later stage.

Solution 2:

Did you try adding LayoutManager in your recyclerView?

Make sure you call setLayoutManager, like below.

recyclerView.setLayoutManager(newLinearLayoutManager(getContext()));

before setting adapter into recyclerView, otherwise it is not gonna work.

Source : - recyclerview-not-call-any-adapter-method

Post a Comment for "E/recyclerview﹕ No Adapter Attached; Skipping Layout"