From d54f46e3d9a4f1fa3699e1c6c0a84029f8d9b6f0 Mon Sep 17 00:00:00 2001 From: Tim Su Date: Sat, 14 Aug 2010 15:17:04 -0700 Subject: [PATCH] Fix for task editing from widget not working --- astrid/src/com/todoroo/astrid/dao/TaskDao.java | 6 ++++-- astrid/src/com/todoroo/astrid/widget/TasksWidget.java | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/astrid/src/com/todoroo/astrid/dao/TaskDao.java b/astrid/src/com/todoroo/astrid/dao/TaskDao.java index bbe18991d..debbf747a 100644 --- a/astrid/src/com/todoroo/astrid/dao/TaskDao.java +++ b/astrid/src/com/todoroo/astrid/dao/TaskDao.java @@ -154,8 +154,10 @@ public class TaskDao extends GenericDao { boolean saveSuccessful; ContentValues values = task.getSetValues(); - if(values == null || values.size() == 0) - return false; + if(values == null || values.size() == 0) { + if(task.getDatabaseValues() != null) + return false; + } if (task.getId() == Task.NO_ID) { saveSuccessful = createNew(task); diff --git a/astrid/src/com/todoroo/astrid/widget/TasksWidget.java b/astrid/src/com/todoroo/astrid/widget/TasksWidget.java index f74ae2dc7..576f1fb65 100644 --- a/astrid/src/com/todoroo/astrid/widget/TasksWidget.java +++ b/astrid/src/com/todoroo/astrid/widget/TasksWidget.java @@ -175,6 +175,7 @@ public class TasksWidget extends AppWidgetProvider { } Intent listIntent = new Intent(context, TaskListActivity.class); + listIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); if(filter != null) { listIntent.putExtra(TaskListActivity.TOKEN_FILTER, filter); listIntent.setType(filter.sqlQuery); @@ -184,6 +185,7 @@ public class TasksWidget extends AppWidgetProvider { views.setOnClickPendingIntent(R.id.taskbody, pendingIntent); Intent editIntent = new Intent(context, TaskEditActivity.class); + editIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); if(filter != null && filter.valuesForNewTasks != null) { String values = AndroidUtilities.contentValuesToSerializedString(filter.valuesForNewTasks); editIntent.putExtra(TaskEditActivity.TOKEN_VALUES, values);