Skip to content Skip to sidebar Skip to footer

How To Get The Last Added Data On First In The Listview From Firebase Realtime Database In Android Studio

I have a list view to retrieve the data from firebase realtime database. But the problem is I want to show the last added data on the top of the listview...Its a notice board type

Solution 1:

This has been covered quite a few times before already. I recommend checking out questions on 'newest on top' and on questions on 'reverse'.

The quickest way to get started might be to simply add the items to the start of your ArrayList instead of to the end of it:

myArrayList.add(0, value);

Post a Comment for "How To Get The Last Added Data On First In The Listview From Firebase Realtime Database In Android Studio"