mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 03:29:28 +01:00
Avoid duplicated messages when activity is in background.
onDestroy is not called when navigating to the next activity or bringing the app to background. That's why the adapter was not set to null and all messages were added another time the next time the activity comes to foreground. With this fix, the adapter is set to null in onStop. All in all, the adapter handling may not be the best, but will be replaced by Compose anyway.. Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
5e872564b7
commit
30caa435ae
@ -562,6 +562,7 @@ class ChatActivity :
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
active = false
|
||||
adapter = null
|
||||
this.lifecycle.removeObserver(AudioUtils)
|
||||
this.lifecycle.removeObserver(chatViewModel)
|
||||
}
|
||||
@ -2677,7 +2678,6 @@ class ChatActivity :
|
||||
|
||||
currentlyPlayedVoiceMessage?.let { stopMediaPlayer(it) } // FIXME, mediaplayer can sometimes be null here
|
||||
|
||||
adapter = null
|
||||
disposables.dispose()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user