From 195686cbd6569eb270220db71bfc906059787781 Mon Sep 17 00:00:00 2001 From: Danny Baumann Date: Fri, 15 Mar 2013 12:46:06 +0100 Subject: [PATCH] Fix NPE when clicking on a notification with >= 2 messages on SDK < 16. Seemingly the intents in the task back stack got confused when the pending intent was updated in those versions (the Accounts intent was delivered to MessageList). Avoid that by not updating the current intent, but dropping the old one. Fixes issue #4955. --- src/com/fsck/k9/controller/MessagingController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index 8ee203978..35868805d 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -4939,7 +4939,8 @@ public class MessagingController implements Runnable { } builder.setContentIntent(stack.getPendingIntent( - account.getAccountNumber(), PendingIntent.FLAG_UPDATE_CURRENT)); + account.getAccountNumber(), + PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT)); builder.setDeleteIntent(NotificationActionService.getAcknowledgeIntent(context, account)); // Only ring or vibrate if we have not done so already on this account and fetch