From eb704a948a64967bfc0162bde66ce8e279cd7303 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 19 Oct 2012 16:49:46 -0700 Subject: [PATCH] Fixed a bug where widgets created under the old system could use the wrong fragment --- astrid/src/com/todoroo/astrid/activity/AstridActivity.java | 2 +- astrid/src/com/todoroo/astrid/widget/TasksWidget.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/astrid/src/com/todoroo/astrid/activity/AstridActivity.java b/astrid/src/com/todoroo/astrid/activity/AstridActivity.java index fa4cebaf9..36d892735 100644 --- a/astrid/src/com/todoroo/astrid/activity/AstridActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/AstridActivity.java @@ -253,7 +253,7 @@ public class AstridActivity extends FragmentActivity return SubtasksListFragment.class; } - private static boolean isTagFilter(Filter filter) { + public static boolean isTagFilter(Filter filter) { if (filter instanceof FilterWithCustomIntent) { String className = ((FilterWithCustomIntent) filter).customTaskList.getClassName(); if (TagViewFragment.class.getName().equals(className) diff --git a/astrid/src/com/todoroo/astrid/widget/TasksWidget.java b/astrid/src/com/todoroo/astrid/widget/TasksWidget.java index 0a016c86a..77e4e6960 100644 --- a/astrid/src/com/todoroo/astrid/widget/TasksWidget.java +++ b/astrid/src/com/todoroo/astrid/widget/TasksWidget.java @@ -32,6 +32,7 @@ import com.todoroo.andlib.sql.Criterion; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.Preferences; +import com.todoroo.astrid.actfm.TagViewFragment; import com.todoroo.astrid.activity.AstridActivity; import com.todoroo.astrid.activity.TaskEditActivity; import com.todoroo.astrid.activity.TaskEditFragment; @@ -174,6 +175,8 @@ public class TasksWidget extends AppWidgetProvider { Filter filter = null; try { filter = getFilter(widgetId); + if (AstridActivity.isTagFilter(filter)) + ((FilterWithCustomIntent) filter).customTaskList = new ComponentName(context, TagViewFragment.class); // In case legacy widget was created with subtasks fragment views.setTextViewText(R.id.widget_title, filter.title); views.removeAllViews(R.id.taskbody);