Hello Everyone, I have loaded some data from Firebase Realtime Database in the App using
Query
.
This is the Simple code :
Query query = databaseReference.orderByChild("name").startAt(data).endAt(data + "\uf8ff");
options = new FirebaseRecyclerOptions.Builder<HomeModel>().setQuery(query, HomeModel.class).build();
My database structure is simple ;
M38dJdquf4jE(the random key)
name : "John Doe"
Image : "image link"
Because of
orderByChild("name")
, whenever a new Data is inserted in the Database is not according to the Time the data is inserted. Instead, it inserts the data in the recyclerView in a Random Order.
How can I fix it, so that the Last data inserted is always at the last in the recyclerView and not inserted in a random manner.