diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java b/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java index a81eb3642..258e90058 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java @@ -194,6 +194,7 @@ public class Notifications extends BroadcastReceiver { notifyIntent.setAction("NOTIFY" + id); //$NON-NLS-1$ notifyIntent.putExtra(TaskListFragment.TOKEN_FILTER, itemFilter); + notifyIntent.putExtra(NotificationFragment.TOKEN_ID, id); notifyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK); notifyIntent.putExtra(TaskListActivity.TOKEN_SOURCE, Constants.SOURCE_NOTIFICATION); @@ -201,10 +202,11 @@ public class Notifications extends BroadcastReceiver { return true; } - private static void requestNotification(int notificationId, Intent intent, int type, String title, String text, int ringTimes) { + private static void requestNotification(long taskId, Intent intent, int type, String title, String text, int ringTimes) { Context context = ContextManager.getContext(); Intent inAppNotify = new Intent(BROADCAST_IN_APP_NOTIFY); - inAppNotify.putExtra(EXTRAS_NOTIF_ID, notificationId); + inAppNotify.putExtra(EXTRAS_NOTIF_ID, (int)taskId); + inAppNotify.putExtra(NotificationFragment.TOKEN_ID, taskId); inAppNotify.putExtra(EXTRAS_CUSTOM_INTENT, intent); inAppNotify.putExtra(EXTRAS_TYPE, type); inAppNotify.putExtra(EXTRAS_TITLE, title); diff --git a/astrid/src/com/todoroo/astrid/activity/AstridActivity.java b/astrid/src/com/todoroo/astrid/activity/AstridActivity.java index 7d6296da3..e7ce1b5c4 100644 --- a/astrid/src/com/todoroo/astrid/activity/AstridActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/AstridActivity.java @@ -332,8 +332,7 @@ public class AstridActivity extends FragmentActivity @Override public void onReceive(Context context, final Intent intent) { // Process in app notification - Intent customIntent = intent.getExtras().getParcelable(Notifications.EXTRAS_CUSTOM_INTENT); - long taskId = customIntent.getLongExtra(NotificationFragment.TOKEN_ID, 0); + long taskId = intent.getLongExtra(NotificationFragment.TOKEN_ID, 0); if (taskId > 0) { String text = intent.getStringExtra(Notifications.EXTRAS_TEXT); try {