15:25:53.476 E/RecyclerView: No adapter attached; omitted layout15:25:53.655 E/RecyclerView: No adapter attached; skipping layoutfor the following code:

ArtistArrayAdapter adapter = new ArtistArrayAdapter(this, artists);recyclerView = (RecyclerView) findViewById(R.id.cardList);recyclerView.setHasFixedSize(true);recyclerView.setAdapter(adapter);recyclerView.setLayoutManager(new LinearLayoutManager(this));As you deserve to see I have actually attached one adapter for RecyclerView.So why carry out I keep acquiring this error?

I have actually read other questions related to the same problem but none of lock help.

You are watching: E/recyclerview: no adapter attached; skipping layout



Can you make sure that you space calling this statements indigenous the "main" thread outside of a delay asynchronous call back (for instance inside the onCreate() method).As shortly as I speak to the exact same statements native a "delayed" method. In my case a ResultCallback, I get the same message.

In mine Fragment, phone call the code below from within a ResultCallback an approach produces the same message. After relocating the password to the onConnected() an approach within mine app, the post was gone...

LinearLayoutManager llm = brand-new LinearLayoutManager(this);llm.setOrientation(LinearLayoutManager.VERTICAL);list.setLayoutManager(llm);list.setAdapter( adapter );



I was getting the exact same two error messages until I solved two things in mine code:

(1) by default, when you implement approaches in the RecyclerView.Adapter the generates:

Overridepublic int getItemCount() return artists.size();Obviously if you have actually zero item in your items then you will obtain zero things displayed on the screen.

See more: Great Places Great Faces South Dakota, Great Faces, Great Places

(2) ns was not doing this as presented in the optimal answer: CardView layout_width="match_parent" go not match parent RecyclerView width

//correctLayoutInflater.from(parent.getContext()) .inflate(R.layout.card_listitem, parent, false);//incorrect (what i had)LayoutInflater.from(parent.getContext()) .inflate(R.layout.card_listitem,null);(3) EDIT: BONUS:Also make sure you collection up your RecyclerView like this:

NOT prefer this:

I have actually seen some tutorials using the last method. If it works I think the generates this error too.


I have the same situation with you, screen is ok, but error show up in the locat.That"s my solution:(1) Initialize the RecyclerView & bind adapter top top CREATE()

RecyclerView mRecycler = (RecyclerView) this.findViewById(R.id.yourid);mRecycler.setAdapter(adapter);(2) call notifyDataStateChanged when you get the data

adapter.notifyDataStateChanged();In the recyclerView"s resource code, over there is other thread to check the state that data.

public RecyclerView(Context context,
Nullable AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); this.mObserver = brand-new RecyclerView.RecyclerViewDataObserver(null); this.mRecycler = brand-new RecyclerView.Recycler(); this.mUpdateChildViewsRunnable = brand-new Runnable() publicly void run() if(RecyclerView.this.mFirstLayoutComplete) if(RecyclerView.this.mDataSetHasChangedAfterLayout) TraceCompat.beginSection("RV FullInvalidate"); RecyclerView.this.dispatchLayout(); TraceCompat.endSection(); rather if(RecyclerView.this.mAdapterHelper.hasPendingUpdates()) TraceCompat.beginSection("RV PartialInvalidate"); RecyclerView.this.eatRequestLayout(); RecyclerView.this.mAdapterHelper.preProcess(); if(!RecyclerView.this.mLayoutRequestEaten) RecyclerView.this.rebindUpdatedViewHolders(); RecyclerView.this.resumeRequestLayout(true); TraceCompat.endSection(); ;In the dispatchLayout(), us can discover there is the error in it:

void dispatchLayout() { if(this.mAdapter == null) Log.e("RecyclerView", "No adapter attached; skipping layout"); else if(this.mLayout == null) Log.e("RecyclerView", "No layout manager attached; omitted layout"); else {