I have a RecyclerView
that displays a list of messages. When the activity starts the RecyclerView
is not populated by the Firebase database. However if I click the back button or an EditText
the RecyclerView
displays all the items correctly. I have tried manually updating it by using the notifyDataSetChanged
method. I have seen other threads, but didn't see anyone with a final solution.
This is the code called during onStart
.
RecyclerView menu = (RecyclerView) findViewById(R.id.chat_view);
LinearLayoutManager manager = new LinearLayoutManager(this);
manager.setReverseLayout(false);
menu.setAdapter(messageAdapter);
menu.setLayoutManager(manager);
messageAdapter.notifyDataSetChanged();`