🛠️ Fix crash when launching activity
This commit is contained in:
parent
e4cc80ab08
commit
0b088874da
1 changed files with 5 additions and 5 deletions
|
|
@ -22,12 +22,12 @@ inline fun Intent.launchActivity(
|
||||||
success: () -> Unit = {},
|
success: () -> Unit = {},
|
||||||
error: () -> Unit = {}
|
error: () -> Unit = {}
|
||||||
) {
|
) {
|
||||||
val intent = if (createChooser) Intent.createChooser(this, "") else this
|
|
||||||
if (openInNewWindow) {
|
|
||||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
val intent = if (createChooser) Intent.createChooser(this, "") else this
|
||||||
|
if (openInNewWindow) {
|
||||||
|
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
|
}
|
||||||
|
|
||||||
activity.baseContext.startActivity(intent)
|
activity.baseContext.startActivity(intent)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue