0

i have a problem with my recyclerview. Whenever I insert new data, it wont be on top of the recycler view.

This is my code to insert new data

 dbRefForm = FirebaseDatabase.getInstance().getReference().child("LIST OF FORM");
 dbRefForm.child(ic_number).setValue(formDataTwo);

My Firebase looks like this. Example image

I also set my recyclerview

LinearLayoutManager mLayoutManager = new LinearLayoutManager(ViewApplicationActivity.this);
        mLayoutManager.setReverseLayout(true);
        mLayoutManager.setStackFromEnd(true);

        recyclerView.setLayoutManager(mLayoutManager);
        recyclerView.setAdapter(adapter);

what did i missed?

  • Please check [here](https://stackoverflow.com/questions/46168245/recyclerview-reverse-order/46168428) – Zain Jun 07 '21 at 14:51
  • yes, i have tried it. but because im using child "ic_number". the recyclerview position in ascending order according to the value number in "ic_number" not the latest data that i inserted –  Jun 07 '21 at 15:15

0 Answers0