diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ConversationsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ConversationsAdapter.kt index 07f8b70b..c895ea85 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ConversationsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ConversationsAdapter.kt @@ -209,10 +209,11 @@ class ConversationsAdapter( } fun updateConversations(newConversations: ArrayList) { + val latestConversations = newConversations.clone() as ArrayList val oldHashCode = conversations.hashCode() - val newHashCode = newConversations.hashCode() + val newHashCode = latestConversations.hashCode() if (newHashCode != oldHashCode) { - conversations = newConversations + conversations = latestConversations notifyDataSetChanged() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ThreadAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ThreadAdapter.kt index 18f513e2..1aead4e9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ThreadAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ThreadAdapter.kt @@ -201,10 +201,11 @@ class ThreadAdapter( private fun isThreadDateTime(position: Int) = messages.getOrNull(position) is ThreadDateTime fun updateMessages(newMessages: ArrayList) { + val latestMessages = newMessages.clone() as ArrayList val oldHashCode = messages.hashCode() - val newHashCode = newMessages.hashCode() + val newHashCode = latestMessages.hashCode() if (newHashCode != oldHashCode) { - messages = newMessages + messages = latestMessages notifyDataSetChanged() recyclerView.scrollToPosition(messages.size - 1) }