From 42c8898c80f72e01e0b23f8cb90a31b0fe223f55 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Wed, 15 Oct 2014 16:56:31 +0300 Subject: [PATCH] Set PendingIntent on crash notification to avoid IllegalArgumentException. --- .../nutomic/syncthingandroid/syncthing/SyncthingRunnable.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingRunnable.java b/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingRunnable.java index 33e2383b..216027a1 100644 --- a/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingRunnable.java +++ b/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingRunnable.java @@ -2,7 +2,9 @@ package com.nutomic.syncthingandroid.syncthing; import android.app.Notification; import android.app.NotificationManager; +import android.app.PendingIntent; import android.content.Context; +import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.v4.app.NotificationCompat; @@ -81,6 +83,7 @@ public class SyncthingRunnable implements Runnable { NotificationCompat.Builder b = new NotificationCompat.Builder(mContext) .setContentTitle(mContext.getString(R.string.binary_crashed_title)) .setContentText(mContext.getString(R.string.binary_crashed_message, ret)) + .setContentIntent(PendingIntent.getActivity(mContext, 0, new Intent(), 0)) .setSmallIcon(R.drawable.ic_launcher) .setAutoCancel(true) .setOnlyAlertOnce(true);