@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.choose_application_help: showInformationDialog( getString(R.string.help_dialog_title), getString(R.string.help_dialog_message)); break; case R.id.choose_application_refresh: showDialog( getString(R.string.choose_application_loading_list_title), getString(R.string.choose_application_loading_list_message), ProgressDialog.STYLE_HORIZONTAL); PDroidAppListLoader appListLoader = new PDroidAppListLoader(getActivity(), new LoadTaskCompleteHandler()); appListLoader.execute(); break; case R.id.choose_application_save_changes: showDialog( getString(R.string.choose_application_saving_title), getString(R.string.choose_application_saving_message)); PDroidAppListSaver appSaver = new PDroidAppListSaver(getActivity(), new SaveTaskCompleteHandler()); appSaver.execute(apps.toArray(new PDroidApplication[apps.size()])); break; } return true; }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); PDroidAppListLoader appListLoader = new PDroidAppListLoader(getActivity(), new LoadTaskCompleteHandler()); appListLoader.execute(); }