diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 03a06d62b..12e827336 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -21,8 +21,8 @@ + android:versionCode="22" + android:versionName="1.5.6"> diff --git a/app/src/main/java/org/isoron/uhabits/HabitBroadcastReceiver.java b/app/src/main/java/org/isoron/uhabits/HabitBroadcastReceiver.java index 23ded62da..695f935b4 100644 --- a/app/src/main/java/org/isoron/uhabits/HabitBroadcastReceiver.java +++ b/app/src/main/java/org/isoron/uhabits/HabitBroadcastReceiver.java @@ -173,10 +173,11 @@ protected void onPostExecute(Void aVoid) contentIntent.setData(data); PendingIntent contentPendingIntent = PendingIntent.getActivity(context, 0, contentIntent, - PendingIntent.FLAG_CANCEL_CURRENT); + PendingIntent.FLAG_UPDATE_CURRENT); PendingIntent dismissPendingIntent = buildDismissIntent(context); - PendingIntent checkIntentPending = buildCheckIntent(context, habit, timestamp); + PendingIntent checkIntentPending = buildCheckIntent(context, + habit, timestamp, 1); PendingIntent snoozeIntentPending = buildSnoozeIntent(context, habit); Uri ringtoneUri = ReminderHelper.getRingtoneUri(context); @@ -223,18 +224,20 @@ public static PendingIntent buildSnoozeIntent(Context context, Habit habit) Intent snoozeIntent = new Intent(context, HabitBroadcastReceiver.class); snoozeIntent.setData(data); snoozeIntent.setAction(ACTION_SNOOZE); - return PendingIntent.getBroadcast(context, 0, snoozeIntent, PendingIntent.FLAG_CANCEL_CURRENT); + return PendingIntent.getBroadcast(context, 0, snoozeIntent, + PendingIntent.FLAG_UPDATE_CURRENT); } - public static PendingIntent buildCheckIntent(Context context, Habit habit, Long timestamp) + public static PendingIntent buildCheckIntent(Context context, Habit + habit, Long timestamp, int requestCode) { Uri data = habit.getUri(); Intent checkIntent = new Intent(context, HabitBroadcastReceiver.class); checkIntent.setData(data); checkIntent.setAction(ACTION_CHECK); if(timestamp != null) checkIntent.putExtra("timestamp", timestamp); - return PendingIntent.getBroadcast(context, 0, checkIntent, - PendingIntent.FLAG_CANCEL_CURRENT); + return PendingIntent.getBroadcast(context, requestCode, checkIntent, + PendingIntent.FLAG_UPDATE_CURRENT); } public static PendingIntent buildDismissIntent(Context context) @@ -242,7 +245,7 @@ public static PendingIntent buildDismissIntent(Context context) Intent deleteIntent = new Intent(context, HabitBroadcastReceiver.class); deleteIntent.setAction(ACTION_DISMISS); return PendingIntent.getBroadcast(context, 0, deleteIntent, - PendingIntent.FLAG_CANCEL_CURRENT); + PendingIntent.FLAG_UPDATE_CURRENT); } public static PendingIntent buildViewHabitIntent(Context context, Habit habit) diff --git a/app/src/main/java/org/isoron/uhabits/widgets/CheckmarkWidgetProvider.java b/app/src/main/java/org/isoron/uhabits/widgets/CheckmarkWidgetProvider.java index cc392ba7e..6f6e12dbc 100644 --- a/app/src/main/java/org/isoron/uhabits/widgets/CheckmarkWidgetProvider.java +++ b/app/src/main/java/org/isoron/uhabits/widgets/CheckmarkWidgetProvider.java @@ -47,7 +47,7 @@ protected void refreshCustomViewData(View view) @Override protected PendingIntent getOnClickPendingIntent(Context context, Habit habit) { - return HabitBroadcastReceiver.buildCheckIntent(context, habit, null); + return HabitBroadcastReceiver.buildCheckIntent(context, habit, null, 2); } @Override