tweak the way adapters are updated
This commit is contained in:
parent
9c0ef0fbe9
commit
b02b54b055
2 changed files with 6 additions and 4 deletions
|
|
@ -209,10 +209,11 @@ class ConversationsAdapter(
|
|||
}
|
||||
|
||||
fun updateConversations(newConversations: ArrayList<Conversation>) {
|
||||
val latestConversations = newConversations.clone() as ArrayList<Conversation>
|
||||
val oldHashCode = conversations.hashCode()
|
||||
val newHashCode = newConversations.hashCode()
|
||||
val newHashCode = latestConversations.hashCode()
|
||||
if (newHashCode != oldHashCode) {
|
||||
conversations = newConversations
|
||||
conversations = latestConversations
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue