Merge pull request #7 from ccg2018/fix-open-app-main

fix(launch): when open the app from launcher, stay current activity
This commit is contained in:
Kr328 authored and GitHub committed 2019-12-08 22:42:47 +08:00
commit 8a2826c242
2 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@
android:name=".MainActivity"
android:label="@string/launch_name"
android:screenOrientation="portrait"
android:launchMode="singleTask">
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
@@ -29,12 +29,14 @@ class ClashNotification(private val context: Service) {
.setContentIntent(
PendingIntent.getActivity(
context,
CLASH_STATUS_NOTIFICATION_ID,
(Math.random() * 100).toInt(),
Intent().setComponent(
ComponentName.createRelative(
context,
MAIN_ACTIVITY_NAME
)
).setFlags(
Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP
),
PendingIntent.FLAG_UPDATE_CURRENT
)