Fixed potential null pointer when constructing certain help info popovers

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

@ -163,7 +163,6 @@ public class TaskRabbitActivity extends FragmentActivity implements LocationList
public void showAddListPopover() { public void showAddListPopover() {
ActionBar actionBar = getSupportActionBar(); ActionBar actionBar = getSupportActionBar();
HelpInfoPopover.showPopover(this, actionBar.getCustomView().findViewById(R.id.menu_nav), R.string.help_popover_add_lists, null); 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() { quickAddBox.postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
HelpInfoPopover.showPopover(getActivity(), quickAddBox, Activity activity = getActivity();
R.string.help_popover_add_task, null); if (activity != null) {
Preferences.setBoolean(R.string.p_showed_add_task_help, true); HelpInfoPopover.showPopover(getActivity(), quickAddBox,
R.string.help_popover_add_task, null);
Preferences.setBoolean(R.string.p_showed_add_task_help, true);
}
} }
}, 1000); }, 1000);
} }
@ -1100,9 +1103,12 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
final View view = getListView().getChildAt( final View view = getListView().getChildAt(
getListView().getChildCount() - 1); getListView().getChildCount() - 1);
if (view != null) { if (view != null) {
HelpInfoPopover.showPopover(getActivity(), view, Activity activity = getActivity();
R.string.help_popover_tap_task, null); if (activity != null) {
Preferences.setBoolean(R.string.p_showed_tap_task_help, true); HelpInfoPopover.showPopover(getActivity(), view,
R.string.help_popover_tap_task, null);
Preferences.setBoolean(R.string.p_showed_tap_task_help, true);
}
} }
} }
} catch (IllegalStateException e) { } catch (IllegalStateException e) {

Loading…
Cancel
Save