0

I have no idea how to fix this problem . I have looked all previous posts on "NO adapter attached; skipping layout" but nothing seems to work.

mResultList.setLayoutManager(linearLayoutManager);
                mResultList.setHasFixedSize(true);
                linearLayoutManager.setReverseLayout(true);
                linearLayoutManager.setStackFromEnd(true);


                mResultList.setAdapter(firebaseRecyclerAdapter);

This is set in another method where the firebase recycler adapter is created. Everything happens inside the fragment .

Jess
  • 11
  • 2
  • 4
    Possible duplicate of [recyclerview No adapter attached; skipping layout](https://stackoverflow.com/questions/29141729/recyclerview-no-adapter-attached-skipping-layout) – godot Mar 26 '18 at 12:20
  • I have tried everything any other ideas? – Jess Apr 04 '18 at 09:58

1 Answers1

0

Can you make sure that you are calling these statements from the "main" thread of fragment. (for example inside the onViewCreate() method).

LinearLayoutManager llm = new LinearLayoutManager(this);
llm.setOrientation(LinearLayoutManager.VERTICAL);
mResultList.setLayoutManager(llm);
mResultList.setAdapter( firebaseRecyclerAdapter );

Hope this helps.

  • Sorry , maybe I haven't explained it well. How can I call the mResultList.setAdapter( firebaseRecyclerAdapter ); in the OnViewCreate method when the firebaseRecyclerAdapter is created in the onStart() method ? Thanks – Jess Mar 27 '18 at 09:04