Display posts in descending posted order

前端 未结 18 1160
南方客
南方客 2020-11-22 11:47

I\'m trying to test out Firebase to allow users to post comments using push. I want to display the data I retrieve with the following;

fbl.child         


        
18条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 12:13

    You can add a column named orderColumn where you save time as

    Long refrenceTime = "large future time"; Long currentTime = "currentTime"; Long order = refrenceTime - currentTime;

    now save Long order in column named orderColumn and when you retrieve data as orderBy(orderColumn) you will get what you need.

提交回复
热议问题