android.app.Activity.onCreateDialog()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(175)

本文整理了Java中android.app.Activity.onCreateDialog()方法的一些代码示例,展示了Activity.onCreateDialog()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.onCreateDialog()方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:onCreateDialog

Activity.onCreateDialog介绍

暂无

代码示例

代码示例来源:origin: k9mail/k-9

@Override
public Dialog onCreateDialog(int dialogId) {
  switch (dialogId) {
    case DIALOG_CONFIRM: {
      return createDeleteConfirmationDialog(dialogId);
    }
  }
  return super.onCreateDialog(dialogId);
}

代码示例来源:origin: novoda/android-demos

@Override
protected Dialog onCreateDialog(int id) {
  Dialog dialog = null;
  
  switch (id) {
    case DIALOG_CHOOSE_VIEW_ID:
      dialog = getChooseViewDialog();
      break;
    default:
      dialog = super.onCreateDialog(id);
  }
  
  return dialog;
}

代码示例来源:origin: shazam/android-aspects

@Override
protected Dialog onCreateDialog(int id) {
  Dialog dialog = super.onCreateDialog(id);
  return dialog != null ? dialog : dispatcher.dispatchOnCreateDialog(this, id);
}

代码示例来源:origin: shazam/android-aspects

@Nullable
@Override
protected Dialog onCreateDialog(int id, Bundle args) {
  Dialog dialog = super.onCreateDialog(id, args);
  return dialog != null ? dialog : dispatcher.dispatchOnCreateDialog(this, id, args);
}

代码示例来源:origin: geniusgithub/AndroidDialer

@Override
protected Dialog onCreateDialog(int id, Bundle bundle) {
  if (id == R.id.dialog_fail_to_export_with_reason) {
    mProcessOngoing = false;
    return new AlertDialog.Builder(this)
        .setTitle(R.string.exporting_contact_failed_title)
        .setMessage(getString(R.string.exporting_contact_failed_message,
            mErrorReason != null ? mErrorReason :
                getString(R.string.fail_reason_unknown)))
        .setPositiveButton(android.R.string.ok, this)
        .setOnCancelListener(this)
        .create();
  }
  return super.onCreateDialog(id, bundle);
}

代码示例来源:origin: geniusgithub/AndroidDialer

@Override
  protected Dialog onCreateDialog(int resId, Bundle bundle) {
    if (resId == R.string.import_from_vcf_file) {
      if (mAccountSelectionListener == null) {
        throw new NullPointerException(
            "mAccountSelectionListener must not be null.");
      }
      return AccountSelectionUtil.getSelectAccountDialog(this, resId,
          mAccountSelectionListener,
          new CancelListener());
    }
    return super.onCreateDialog(resId, bundle);
  }
}

代码示例来源:origin: labexp/osmtracker-android

return super.onCreateDialog(id);

代码示例来源:origin: geniusgithub/AndroidDialer

@Override
protected Dialog onCreateDialog(int id, Bundle bundle) {
  if (id == R.id.dialog_cancel_confirmation) {
    final String message;
    if (mType == VCardService.TYPE_IMPORT) {
      message = getString(R.string.cancel_import_confirmation_message, mDisplayName);
    } else {
      message = getString(R.string.cancel_export_confirmation_message, mDisplayName);
    }
    final AlertDialog.Builder builder = new AlertDialog.Builder(this)
        .setMessage(message)
        .setPositiveButton(android.R.string.ok, new RequestCancelListener())
        .setOnCancelListener(mCancelListener)
        .setNegativeButton(android.R.string.cancel, mCancelListener);
    return builder.create();
  } else if (id == R.id.dialog_cancel_failed) {
    final AlertDialog.Builder builder = new AlertDialog.Builder(this)
        .setTitle(R.string.cancel_vcard_import_or_export_failed)
        .setIconAttribute(android.R.attr.alertDialogIcon)
        .setMessage(getString(R.string.fail_reason_unknown))
        .setOnCancelListener(mCancelListener)
        .setPositiveButton(android.R.string.ok, mCancelListener);
    return builder.create();
  } else {
    Log.w(LOG_TAG, "Unknown dialog id: " + id);
    return super.onCreateDialog(id, bundle);
  }
}

代码示例来源:origin: geniusgithub/AndroidDialer

@Override
protected Dialog onCreateDialog(int resId, Bundle bundle) {
  if (resId == R.id.dialog_cache_vcard) {
    if (mProgressDialogForCachingVCard == null) {
      final String title = getString(R.string.caching_vcard_title);
      final String message = getString(R.string.caching_vcard_message);
      mProgressDialogForCachingVCard = new ProgressDialog(this);
      mProgressDialogForCachingVCard.setTitle(title);
      mProgressDialogForCachingVCard.setMessage(message);
      mProgressDialogForCachingVCard.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      mProgressDialogForCachingVCard.setOnCancelListener(mVCardCacheThread);
      startVCardService();
    }
    return mProgressDialogForCachingVCard;
  } else if (resId == R.id.dialog_error_with_message) {
    String message = mErrorMessage;
    if (TextUtils.isEmpty(message)) {
      Log.e(LOG_TAG, "Error message is null while it must not.");
      message = getString(R.string.fail_reason_unknown);
    }
    final AlertDialog.Builder builder = new AlertDialog.Builder(this)
      .setTitle(getString(R.string.reading_vcard_failed_title))
      .setIconAttribute(android.R.attr.alertDialogIcon)
      .setMessage(message)
      .setOnCancelListener(mCancelListener)
      .setPositiveButton(android.R.string.ok, mCancelListener);
    return builder.create();
  }
  return super.onCreateDialog(resId, bundle);
}

代码示例来源:origin: openintents/notepad

dialog = super.onCreateDialog(id);

相关文章

Activity类方法