Fix PiP crash with IllegalStateException. Activity must be resumed to enter PiP mode.
https://sentry.tools.element.io/organizations/element/issues/1449388/events/2eb06349f6224481960a64916d51ae60/?project=59
This commit is contained in:
parent
41126c7027
commit
77564d7870
1 changed files with 5 additions and 1 deletions
|
|
@ -281,7 +281,11 @@ class ElementCallActivity :
|
|||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun enterPipMode(): Boolean {
|
||||
return enterPictureInPictureMode(getPictureInPictureParams())
|
||||
return if (lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
|
||||
enterPictureInPictureMode(getPictureInPictureParams())
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue