Fix crash on save after rotating manual lists

pull/384/head
Alex Baker 9 years ago
parent f05a96931d
commit a063a6d60e

@ -9,6 +9,7 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ListView;
import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.astrid.activity.TaskListFragment; import com.todoroo.astrid.activity.TaskListFragment;
@ -75,8 +76,6 @@ public class SubtasksListFragment extends TaskListFragment {
helper.beforeSetUpTaskList(filter); helper.beforeSetUpTaskList(filter);
super.setUpTaskList(); super.setUpTaskList();
unregisterForContextMenu(getListView());
} }
@Override @Override
@ -88,9 +87,11 @@ public class SubtasksListFragment extends TaskListFragment {
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
if (lastVisibleIndex >=0) { ListView listView = getListView();
getListView().setSelection(lastVisibleIndex); if (lastVisibleIndex >= 0) {
listView.setSelection(lastVisibleIndex);
} }
unregisterForContextMenu(listView);
} }
@Override @Override

@ -68,8 +68,6 @@ public class SubtasksTagListFragment extends TagViewFragment {
helper.beforeSetUpTaskList(filter); helper.beforeSetUpTaskList(filter);
super.setUpTaskList(); super.setUpTaskList();
unregisterForContextMenu(getListView());
} }
@Override @Override
@ -84,6 +82,7 @@ public class SubtasksTagListFragment extends TagViewFragment {
if (lastVisibleIndex >= 0) { if (lastVisibleIndex >= 0) {
getListView().setSelection(lastVisibleIndex); getListView().setSelection(lastVisibleIndex);
} }
unregisterForContextMenu(getListView());
} }
@Override @Override

Loading…
Cancel
Save