Fixed a crash when deleting the current list while swipe enabled

pull/14/head
Sam Bosley 12 years ago
parent d9bbb20419
commit 05a2f57c4a

@ -484,8 +484,8 @@ public class TagViewFragment extends TaskListFragment {
// 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 class TagViewFragment extends TaskListFragment {
public void onPause() {
super.onPause();
getActivity().unregisterReceiver(notifyReceiver);
AndroidUtilities.tryUnregisterReceiver(getActivity(), notifyReceiver);
}
@Override

@ -52,6 +52,7 @@ import com.todoroo.astrid.adapter.FilterAdapter;
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 @@ public class FilterListFragment extends ListFragment {
public void switchToActiveTasks() {
if (adapter.getCount() > 0)
setFilterItemSelected(adapter.getItem(0), 0);
else
setFilterItemSelected(CoreFilterExposer.buildInboxFilter(getResources()), 0);
}
@Override

Loading…
Cancel
Save