Fixed potential null pointer when constructing certain help info popovers

pull/14/head
Sam Bosley 13 years ago
parent 62c683fc85
commit 74e1c62a14

@ -163,7 +163,6 @@ public class TaskRabbitActivity extends FragmentActivity implements LocationList
public void showAddListPopover() {
ActionBar actionBar = getSupportActionBar();
HelpInfoPopover.showPopover(this, actionBar.getCustomView().findViewById(R.id.menu_nav), R.string.help_popover_add_lists, null);
}

@ -931,9 +931,12 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
quickAddBox.postDelayed(new Runnable() {
@Override
public void run() {
HelpInfoPopover.showPopover(getActivity(), quickAddBox,
R.string.help_popover_add_task, null);
Preferences.setBoolean(R.string.p_showed_add_task_help, true);
Activity activity = getActivity();
if (activity != null) {
HelpInfoPopover.showPopover(getActivity(), quickAddBox,
R.string.help_popover_add_task, null);
Preferences.setBoolean(R.string.p_showed_add_task_help, true);
}
}
}, 1000);
}
@ -1100,9 +1103,12 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
final View view = getListView().getChildAt(
getListView().getChildCount() - 1);
if (view != null) {
HelpInfoPopover.showPopover(getActivity(), view,
R.string.help_popover_tap_task, null);
Preferences.setBoolean(R.string.p_showed_tap_task_help, true);
Activity activity = getActivity();
if (activity != null) {
HelpInfoPopover.showPopover(getActivity(), view,
R.string.help_popover_tap_task, null);
Preferences.setBoolean(R.string.p_showed_tap_task_help, true);
}
}
}
} catch (IllegalStateException e) {

Loading…
Cancel
Save