File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
app/src/main/kotlin/com/simplemobiletools/launcher/extensions Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 11package com.simplemobiletools.launcher.extensions
22
33import android.app.Activity
4- import android.content.ActivityNotFoundException
54import android.content.ComponentName
65import android.content.Intent
76import android.net.Uri
@@ -26,10 +25,13 @@ fun Activity.launchApp(packageName: String, activityName: String) {
2625 addFlags(Intent .FLAG_RECEIVER_FOREGROUND )
2726 startActivity(this )
2827 }
29- } catch (e: ActivityNotFoundException ) {
30- showErrorToast(e)
3128 } catch (e: Exception ) {
32- showErrorToast(e)
29+ try {
30+ val launchIntent = packageManager.getLaunchIntentForPackage(packageName)
31+ startActivity(launchIntent)
32+ } catch (e: Exception ) {
33+ showErrorToast(e)
34+ }
3335 }
3436}
3537
You can’t perform that action at this time.
0 commit comments