mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-05-03 14:56:20 +00:00
Prevent crash in activity if dialog can't be shown
This commit is contained in:
parent
601aaf0b5c
commit
a743a0d2c6
1 changed files with 6 additions and 1 deletions
|
|
@ -31,6 +31,7 @@ import android.os.Parcelable
|
||||||
import android.view.Gravity
|
import android.view.Gravity
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.ViewTreeObserver
|
import android.view.ViewTreeObserver
|
||||||
|
import android.view.WindowManager
|
||||||
import androidx.activity.SystemBarStyle
|
import androidx.activity.SystemBarStyle
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
|
|
@ -262,7 +263,11 @@ class MainActivity : GenericActivity() {
|
||||||
|
|
||||||
coreContext.digestAuthenticationRequestedEvent.observe(this) {
|
coreContext.digestAuthenticationRequestedEvent.observe(this) {
|
||||||
it.consume { identity ->
|
it.consume { identity ->
|
||||||
|
try {
|
||||||
showAuthenticationRequestedDialog(identity)
|
showAuthenticationRequestedDialog(identity)
|
||||||
|
} catch (e: WindowManager.BadTokenException) {
|
||||||
|
Log.e("$TAG Failed to show authentication dialog: $e")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue