We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e91917b commit 661ff46Copy full SHA for 661ff46
1 file changed
app/src/main/kotlin/com/simplemobiletools/launcher/extensions/Activity.kt
@@ -1,7 +1,6 @@
1
package com.simplemobiletools.launcher.extensions
2
3
import android.app.Activity
4
-import android.content.ActivityNotFoundException
5
import android.content.ComponentName
6
import android.content.Intent
7
import android.net.Uri
@@ -26,10 +25,13 @@ fun Activity.launchApp(packageName: String, activityName: String) {
26
25
addFlags(Intent.FLAG_RECEIVER_FOREGROUND)
27
startActivity(this)
28
}
29
- } catch (e: ActivityNotFoundException) {
30
- showErrorToast(e)
31
} catch (e: Exception) {
32
+ try {
+ val launchIntent = packageManager.getLaunchIntentForPackage(packageName)
+ startActivity(launchIntent)
+ } catch (e: Exception) {
33
+ showErrorToast(e)
34
+ }
35
36
37
0 commit comments