Permalink
Browse files

Fixed a crash when deleting the current list while swipe enabled

  • Loading branch information...
1 parent d9bbb20 commit 05a2f57c4a2f49155f3ade15452292aea0fa689c @sbosley sbosley committed Aug 31, 2012
@@ -484,8 +484,8 @@ public void onResume() {
// go back to active tasks
FilterListFragment fl = ((AstridActivity) getActivity()).getFilterListFragment();
if (fl != null) {
- fl.switchToActiveTasks();
fl.clear(); // Should auto refresh
+ fl.switchToActiveTasks();
}
return;
}
@@ -503,7 +503,7 @@ public void onResume() {
public void onPause() {
super.onPause();
- getActivity().unregisterReceiver(notifyReceiver);
+ AndroidUtilities.tryUnregisterReceiver(getActivity(), notifyReceiver);
}
@Override
@@ -52,6 +52,7 @@
import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.FilterListItem;
+import com.todoroo.astrid.core.CoreFilterExposer;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.tags.TagService;
import com.todoroo.astrid.tags.TagsPlugin;
@@ -312,6 +313,8 @@ private void setFilterItemSelected(Filter item, int position) {
public void switchToActiveTasks() {
if (adapter.getCount() > 0)
setFilterItemSelected(adapter.getItem(0), 0);
+ else
+ setFilterItemSelected(CoreFilterExposer.buildInboxFilter(getResources()), 0);
}
@Override

0 comments on commit 05a2f57

Please sign in to comment.