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:
2 files changed
+4
-2
No files matched your search
@@ -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
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user