コード例 #1
0
    @Override
    protected void onPreExecute() {
      if (dialogShow) {
        progDialog = new ProgressDialog(RssReaderActivity.this);
        progDialog.setCancelable(false);
        progDialog.setMessage(getString(R.string.rss_fetching));
        progDialog.setButton(
            DialogInterface.BUTTON_NEGATIVE,
            getString(R.string.btn_hide_text),
            new DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
                Toast.makeText(
                        RssReaderActivity.this, R.string.rss_keep_updating, Toast.LENGTH_SHORT)
                    .show();
              }
            });
        progDialog.show();
      } else
        Toast.makeText(RssReaderActivity.this, R.string.rss_start_updating, Toast.LENGTH_SHORT)
            .show();

      isTaskRunning = true;
    }
コード例 #2
0
  void requestAccountList() {
    prog =
        ProgressDialog.show(
            this,
            null,
            getString(R.string.account_list_progress),
            false,
            true,
            new DialogInterface.OnCancelListener() {
              public void onCancel(DialogInterface dialog) {
                cancel();
              }
            });

    queryThread = new Thread(this, "Requestor Thread");
    queryThread.setDaemon(true);
    queryThread.start();
  }