Commit 47bbafe5 authored by Samer Alabi's avatar Samer Alabi

Fixed Fragment Replacement Issue

parent b042c314
...@@ -86,9 +86,11 @@ class ChatRoomActivity : AppCompatActivity(), HasSupportFragmentInjector { ...@@ -86,9 +86,11 @@ class ChatRoomActivity : AppCompatActivity(), HasSupportFragmentInjector {
isChatRoomSubscribed = intent.getBooleanExtra(INTENT_CHAT_IS_SUBSCRIBED, true) isChatRoomSubscribed = intent.getBooleanExtra(INTENT_CHAT_IS_SUBSCRIBED, true)
addFragment("ChatRoomFragment", R.id.fragment_container) { if (supportFragmentManager.findFragmentByTag("ChatRoomFragment") == null) {
newInstance(chatRoomId, chatRoomName, chatRoomType, isChatRoomReadOnly, chatRoomLastSeen, addFragment("ChatRoomFragment", R.id.fragment_container) {
isChatRoomSubscribed) newInstance(chatRoomId, chatRoomName, chatRoomType, isChatRoomReadOnly, chatRoomLastSeen,
isChatRoomSubscribed)
}
} }
} }
......
...@@ -13,8 +13,8 @@ class CancelStrategy @Inject constructor(owner: LifecycleOwner, val jobs: Job) : ...@@ -13,8 +13,8 @@ class CancelStrategy @Inject constructor(owner: LifecycleOwner, val jobs: Job) :
owner.lifecycle.addObserver(this) owner.lifecycle.addObserver(this)
} }
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
fun onDestroy() { fun onStop() {
jobs.cancel() jobs.cancel()
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment