diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1fdfeb2..2a14901 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -19,7 +19,7 @@ android:name=".MainActivity" android:label="@string/launch_name" android:screenOrientation="portrait" - android:launchMode="singleTask"> + android:launchMode="singleTop"> diff --git a/service/src/main/java/com/github/kr328/clash/service/ClashNotification.kt b/service/src/main/java/com/github/kr328/clash/service/ClashNotification.kt index 6138317..51a5e55 100644 --- a/service/src/main/java/com/github/kr328/clash/service/ClashNotification.kt +++ b/service/src/main/java/com/github/kr328/clash/service/ClashNotification.kt @@ -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 )