Ordering Users List based on MessageList - Kotlin & Android
问题 I am trying to sort a list of User Objects by the order in which User IDs appear in the MessageList Array. The MessageList consists of ID's of people a user is chatting with (ordered by time - using sortwith), which is then to be sent to a User Adapter as a list of Users in the same order as the message list. This is so that username, profile image and other details can be displayed... I have learnt a datasnapshot of the Users from firebase provides as is order and hence needs to be ordered