Sort chat-list by the most recent message with firebase
问题 I don't know why I got stuck in a problem that the chatList is not sorting by the last message time or by the most recent message. I have tried storing timestamp in the database and orderChildBy timestamp but it still not working. not working means the list get not sort after every message and keep showing the list as the sorted after first message. Look at the image how chats are disordered! This is the way I created chatList in the firebaseDatabase in ChatActiviy on sendMessage: val timeAgo