So I am trying to show the most recent node on the top of the recyclerview
I want to add the most recent child to the top of the database so that i can retrieve them in the same order.
I know I can reverse the recyclerview .so that It will be shown in the correct order but I am using Firebase Pagination. which is causing issues
So I want to add the most recent child to the top of this database, is it possible with any Algorithm or Firebase methods?
This is the code to add the data to the firebase
FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();
DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference("Admin").
child(firebaseAuth.getUid())
.child("INSTITUTE").child("CLASSES").push();
ClassesHelper classesHelper = new ClassesHelper(classnamestring,"Empty",time,"0",presentTeacherid);
dialogprogressbar.setVisibility(View.GONE);
databaseReference.setValue(classesHelper);