From f58f7cf38f2f0ecf70979edbef82365ef3a54303 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Tue, 6 May 2014 13:28:57 +0200 Subject: [PATCH] Open Activity on Notification click. --- src/com/nutomic/syncthingandroid/SyncthingService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/nutomic/syncthingandroid/SyncthingService.java b/src/com/nutomic/syncthingandroid/SyncthingService.java index 1febbf44..eca64fc7 100644 --- a/src/com/nutomic/syncthingandroid/SyncthingService.java +++ b/src/com/nutomic/syncthingandroid/SyncthingService.java @@ -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);