Only create one intent per notification
Change-Id: I0046017e6da2941b40ebd2762b5188a62fadef34
diff --git a/src/com/android/mail/utils/NotificationUtils.java b/src/com/android/mail/utils/NotificationUtils.java
index 102f58c..1e2ffaf 100644
--- a/src/com/android/mail/utils/NotificationUtils.java
+++ b/src/com/android/mail/utils/NotificationUtils.java
@@ -555,14 +555,15 @@
if (unreadCount > 0) {
// How can I order this properly?
if (cursor.moveToNext()) {
- Intent notificationIntent = createViewConversationIntent(context, account,
- folder, null);
+ final Intent notificationIntent;
- // Launch directly to the conversation, if the
- // number of unseen conversations == 1
+ // Launch directly to the conversation, if there is only 1 unseen conversation
if (unseenCount == 1) {
notificationIntent = createViewConversationIntent(context, account, folder,
cursor);
+ } else {
+ notificationIntent = createViewConversationIntent(context, account, folder,
+ null);
}
if (notificationIntent == null) {