🛠️ 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 = {},
|
||||
error: () -> Unit = {}
|
||||
) {
|
||||
try {
|
||||
val intent = if (createChooser) Intent.createChooser(this, "") else this
|
||||
if (openInNewWindow) {
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
}
|
||||
|
||||
try {
|
||||
activity.baseContext.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue