Android - How to retrieve list of objects in their insertion order from Firebase?

后端 未结 4 472
别跟我提以往
别跟我提以往 2021-01-14 11:47

What do I want?

I want to retrieve the list of objects in their insertion order from Firebase Database.

How am I adding the object

4条回答
  •  醉话见心
    2021-01-14 12:18

    Have you read documentation? Data keys is timestamp based, so they ordered by time. To get sorted query you must use orderByKey() on database reference. More about it https://firebase.google.com/docs/database/android/retrieve-data#sorting_and_filtering_data

提交回复
热议问题