Пример #1
0
 @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;
 }
Пример #2
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   PDroidAppListLoader appListLoader =
       new PDroidAppListLoader(getActivity(), new LoadTaskCompleteHandler());
   appListLoader.execute();
 }