Skip to content

Commit 49f5fc5

Browse files
committed
1. Fix back navigation in call-activity
1 parent 91eeb90 commit 49f5fc5

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

demo-app/src/main/kotlin/io/getstream/video/android/CallActivity.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,17 +283,17 @@ class CallActivity : ComposeStreamCallActivity() {
283283
}
284284

285285
private fun StreamCallActivity.goBackToMainScreen() {
286-
if (!isFinishing) {
287-
val intent = Intent(this, MainActivity::class.java).apply {
288-
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
289-
}
290-
startActivity(intent)
291-
safeFinish()
292-
}
286+
safeFinish()
293287
}
294288
}
295289

296290
override fun finish() {
291+
if (isTaskRoot && !isFinishing) {
292+
val intent = Intent(this, MainActivity::class.java).apply {
293+
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
294+
}
295+
startActivity(intent)
296+
}
297297
super.finish()
298298
observeCallReadyToJoinJob?.cancel()
299299
observeRingingJob?.cancel()

0 commit comments

Comments
 (0)