Skip to content

Commit

Permalink
Fixed a crash when deleting the current list while swipe enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sbosley committed Aug 31, 2012
1 parent d9bbb20 commit 05a2f57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -484,8 +484,8 @@ public void onResume() {
// go back to active tasks // go back to active tasks
FilterListFragment fl = ((AstridActivity) getActivity()).getFilterListFragment(); FilterListFragment fl = ((AstridActivity) getActivity()).getFilterListFragment();
if (fl != null) { if (fl != null) {
fl.switchToActiveTasks();
fl.clear(); // Should auto refresh fl.clear(); // Should auto refresh
fl.switchToActiveTasks();
} }
return; return;
} }
Expand All @@ -503,7 +503,7 @@ public void onResume() {
public void onPause() { public void onPause() {
super.onPause(); super.onPause();


getActivity().unregisterReceiver(notifyReceiver); AndroidUtilities.tryUnregisterReceiver(getActivity(), notifyReceiver);
} }


@Override @Override
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.api.Filter; import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.FilterListItem; import com.todoroo.astrid.api.FilterListItem;
import com.todoroo.astrid.core.CoreFilterExposer;
import com.todoroo.astrid.service.StatisticsService; import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.tags.TagService; import com.todoroo.astrid.tags.TagService;
import com.todoroo.astrid.tags.TagsPlugin; import com.todoroo.astrid.tags.TagsPlugin;
Expand Down Expand Up @@ -312,6 +313,8 @@ private void setFilterItemSelected(Filter item, int position) {
public void switchToActiveTasks() { public void switchToActiveTasks() {
if (adapter.getCount() > 0) if (adapter.getCount() > 0)
setFilterItemSelected(adapter.getItem(0), 0); setFilterItemSelected(adapter.getItem(0), 0);
else
setFilterItemSelected(CoreFilterExposer.buildInboxFilter(getResources()), 0);
} }


@Override @Override
Expand Down

0 comments on commit 05a2f57

Please sign in to comment.