mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-22 20:31:16 +00:00
Open Activity on Notification click.
This commit is contained in:
parent
469de1d412
commit
f58f7cf38f
1 changed files with 5 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
package com.nutomic.syncthingandroid;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
@ -14,9 +15,13 @@ public class SyncthingService extends Service {
|
|||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
PendingIntent pi = PendingIntent.getActivity(
|
||||
this, 0, new Intent(this, WebGuiActivity.class),
|
||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
Notification n = new Notification.Builder(this)
|
||||
.setContentTitle(getString(R.string.app_name))
|
||||
.setSmallIcon(R.drawable.ic_launcher)
|
||||
.setContentIntent(pi)
|
||||
.build();
|
||||
startForeground(NOTIFICATION_ID, n);
|
||||
|
||||
|
|
Loading…
Reference in a new issue