I'm creating a recyclerView using FirestoreRecyclerAdapter, in which I want to search for an email in my firestore using an EditText. If the email exists in firestore, a cardview should appear in my recyclerView with the user's name and if not it should print out "no data found".
But for some reason, the methods onBindViewHolder, onCreateViewHolder and AddUserViewHolder is not called. I see that I receive this error message:
E/RecyclerView: No adapter attached; skipping layout
for the following code:
private void InitRecyclerView() {
recyclerViewAddUser = findViewById(R.id.userRecyclerView);
recyclerViewAddUser.setHasFixedSize(true);
recyclerViewAddUser.setLayoutManager(new LinearLayoutManager(UserToProject.this));
recyclerViewAddUser.setAdapter(adapter);
recyclerViewAddUser.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
closeKeyboard(view);
return false;
}
});
}
As you see I’ve attached the adapter for my recyclerwiew, so I don’t know why I get this error.
Hope this makes sense, please reach out if it doesn't. Thank you in advance.