1

getting the problem of E/RecyclerView: No adapter attached; skipping layout during the app open time.

private RecyclerView recyclerView;

private UserAdapter userAdapter;
private List<User> mUsers;

FirebaseUser fuser;
DatabaseReference reference;

private List<Chatlist> usersList;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_chats, container, false);

    recyclerView = view.findViewById(R.id.recycler_view);
    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));

    fuser = FirebaseAuth.getInstance().getCurrentUser();

please help

brandonx
  • 228
  • 2
  • 13
Dhiman
  • 55
  • 4

1 Answers1

0

It looks like you are declaring an adapter at the top of the file but I don't see that you are setting your datasource on to the adapter and then setting the adapter on the recycler like so:

userAdapter = new UserAdapter(mUsers);
recyclerView.setAdapter(userAdapter);

Also, have you written a complete UserAdapter?

Google has some great docs with examples of how to implement Recyclerview: https://developer.android.com/guide/topics/ui/layout/recyclerview

brandonx
  • 228
  • 2
  • 13