mirror of
https://github.com/yggdrasil-network/crispa-android.git
synced 2024-11-09 12:01:01 +00:00
1. open MainActivity after Notification click, task #12
This commit is contained in:
parent
507602cd2b
commit
0281b9c5c5
@ -16,11 +16,13 @@
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
<activity
|
||||
android:name=".PeerListActivity"
|
||||
android:parentActivityName=".MainActivity"
|
||||
android:label="@string/title_activity_peer_list"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name=".DNSListActivity"
|
||||
android:parentActivityName=".MainActivity"
|
||||
android:label="@string/title_activity_dns_list"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:screenOrientation="portrait"/>
|
||||
|
@ -1,9 +1,6 @@
|
||||
package io.github.chronosx88.yggdrasil
|
||||
|
||||
import android.app.Notification
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.app.PendingIntent
|
||||
import android.app.*
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.ConnectivityManager
|
||||
@ -292,8 +289,13 @@ class YggdrasilTunService : VpnService() {
|
||||
// https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html#NotificationCompat.Builder(android.content.Context)
|
||||
""
|
||||
}
|
||||
var intent = Intent(this, MainActivity::class.java)
|
||||
var stackBuilder = TaskStackBuilder.create(this)
|
||||
stackBuilder.addNextIntentWithParentStack(intent)
|
||||
var pi = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
val b = NotificationCompat.Builder(this, channelId)
|
||||
b.setOngoing(true)
|
||||
.setContentIntent(pi)
|
||||
.setContentTitle(getString(R.string.app_name))
|
||||
.setContentText(text)
|
||||
.setSmallIcon(R.mipmap.ic_launcher)
|
||||
|
Loading…
Reference in New Issue
Block a user