Added try/catch to fix crash when showing task edit popover after delay

pull/14/head
Sam Bosley 14 years ago
parent 947f0fe1b7
commit 8a023f9409

@ -1054,6 +1054,7 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
imm.hideSoftInputFromWindow(quickAddBox.getWindowToken(), 0);
getListView().postDelayed(new Runnable() {
public void run() {
try {
if (taskAdapter != null && taskAdapter.getCount() > 0) {
final View view = getListView().getChildAt(
getListView().getChildCount() - 1);
@ -1063,6 +1064,9 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
Preferences.setBoolean(R.string.p_showed_tap_task_help, true);
}
}
} catch (IllegalStateException e) {
// Whoops, view is gone. Try again later
}
}
}, 1000L);

Loading…
Cancel
Save