本文整理了Java中android.support.v7.app.AlertDialog.setTitle()
方法的一些代码示例,展示了AlertDialog.setTitle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AlertDialog.setTitle()
方法的具体详情如下:
包路径:android.support.v7.app.AlertDialog
类名称:AlertDialog
方法名:setTitle
暂无
代码示例来源:origin: czy1121/update
dialog.setTitle("应用更新");
dialog.setCancelable(false);
dialog.setCanceledOnTouchOutside(false);
代码示例来源:origin: derry/delion
public void update(String title, String instructions, boolean shouldRequestExpirationDate) {
assert mDialog.isShowing();
mDialog.setTitle(title);
mInstructions.setText(instructions);
mShouldRequestExpirationDate = shouldRequestExpirationDate;
showExpirationDateInputsInputs();
}
代码示例来源:origin: prabhat1707/EasyWayLocation
public void showAlertDialog(String title, String message, Drawable drawable){
AlertDialog alertDialog = new AlertDialog.Builder(context).create();
alertDialog.setTitle(title);
if (drawable != null)
{
alertDialog.setIcon(drawable);
}
alertDialog.setMessage(message);
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, context.getString(R.string.ok),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertDialog.show();
}
代码示例来源:origin: zilianliuxue/TBShoppingCart
@Override
public void onClick(View v) {
AlertDialog alert = new AlertDialog.Builder(context).create();
alert.setTitle("操作提示");
alert.setMessage("您确定要将这些商品从购物车中移除吗?");
alert.setButton(DialogInterface.BUTTON_NEGATIVE, "取消",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
return;
}
});
alert.setButton(DialogInterface.BUTTON_POSITIVE, "确定",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
modifyCountInterface.childDelete(groupPosition, childPosition);
}
});
alert.show();
}
});
代码示例来源:origin: pencilso/ManyBlue
@Override
public void onClick(View view) {
super.onClick(view);
final String address = view.getTag().toString();
AlertDialog alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setTitle("发送指令");
final View inflate = LayoutInflater.from(this).inflate(R.layout.dialog_input, null);
DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (which == AlertDialog.BUTTON_POSITIVE) {
AppCompatEditText editText = (AppCompatEditText) inflate.findViewById(R.id.dialog_input_editText);
String str = editText.getText().toString();
if (str.trim().length() != 0) {
setDialog("正在向设备写出数据");
ManyBlue.blueWriteDataStr2Hex(str, address);
}
}
dialog.dismiss();
}
};
alertDialog.setView(inflate);
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "发送", listener);
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "取消", listener);
alertDialog.show();
}
代码示例来源:origin: marcoscgdev/EasyLicensesDialog
public void showAboutDialog() {
String msg = getResources().getString(R.string.about_text);
AlertDialog alertDialog = new AlertDialog.Builder(this, R.style.DialogStyle).create();
alertDialog.setTitle("About " + getResources().getString(R.string.library_name));
alertDialog.setMessage(Html.fromHtml(msg));
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE,"Close",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
alertDialog.setButton(DialogInterface.BUTTON_NEUTRAL,"View on GitHub",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/marcoscgdev/EasyLicensesDialog")));
}
});
alertDialog.show();
TextView messageView = (TextView)alertDialog.findViewById(android.R.id.message);
messageView.setGravity(Gravity.CENTER);
messageView.setTextColor(Color.parseColor("#757575"));
((TextView)alertDialog.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
}
代码示例来源:origin: AppLozic/Applozic-Android-SDK
@Override
public void onFailure(Exception exception) {
userLogoutTask = null;
AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create();
alertDialog.setTitle(getString(R.string.text_alert));
alertDialog.setMessage(exception.toString());
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, getString(R.string.ok_alert),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
if (!isFinishing()) {
alertDialog.show();
}
}
};
代码示例来源:origin: CoderLengary/WanAndroid
@Override
public void showAutoLoginFail() {
final AlertDialog alertDialog = new AlertDialog.Builder(getContext()).create();
alertDialog.setTitle(R.string.warning_title);
alertDialog.setMessage(getString(R.string.tip));
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.sure), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
MainActivity main = (MainActivity) getActivity();
main.navigateToLogin();
alertDialog.dismiss();
}
});
alertDialog.show();
}
代码示例来源:origin: zilianliuxue/TBShoppingCart
alert.setTitle("操作提示");
alert.setMessage("您确定要将这些商品从购物车中移除吗?");
alert.setButton(DialogInterface.BUTTON_NEGATIVE, "取消",
alert.setTitle("操作提示");
alert.setMessage("总计:\n" + totalCount + "种商品\n" + totalPrice + "元");
alert.setButton(DialogInterface.BUTTON_NEGATIVE, "取消",
代码示例来源:origin: itzuo/ShoppingCart
alert.setTitle("操作提示");
alert.setMessage("总计:\n" + totalCount + "种商品\n" + totalPrice + "元");
alert.setButton(DialogInterface.BUTTON_NEGATIVE, "取消", new DialogInterface.OnClickListener() {
alert.setTitle("操作提示");
alert.setMessage("您确定要将这些商品从购物车中移除吗?");
alert.setButton(DialogInterface.BUTTON_NEGATIVE, "取消", new DialogInterface.OnClickListener() {
代码示例来源:origin: CoderLengary/WanAndroid
private void showAlertDialog() {
final AlertDialog alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setTitle(R.string.warning_title);
alertDialog.setMessage(getString(R.string.warning_desc));
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
alertDialog.dismiss();
}
});
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.sure), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
navigateToLogin();
}
});
alertDialog.show();
}
代码示例来源:origin: Wensibob/GankClient
public void openAliPay() {
AlertDialog dialog = new AlertDialog.Builder(activity).create();
dialog.setTitle(R.string.coffee);
dialog.setMessage(activity.getString(R.string.donate_content));
dialog.setButton(DialogInterface.BUTTON_POSITIVE, activity.getString(R.string.positive), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
APPUtil.copyToClipboard(context,activity.getString(R.string.alipay_account));
}
});
dialog.setButton(DialogInterface.BUTTON_NEGATIVE, activity.getString(R.string.negative), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
dialog.show();
}
代码示例来源:origin: stewForAni/Lamp
dialog.setTitle(getResources().getString(R.string.remind));
dialog.setMessage(getResources().getString(R.string.wait));
dialog.show();
代码示例来源:origin: calvinaquino/LNReader-Android
@SuppressLint({"NewApi"})
private void checkDBAccess() {
task = new CheckDBReadyTask(this);
String key = TAG + ":CheckDBAccess";
boolean isAdded = LNReaderApplication.getInstance().addTask(key, task);
if (isAdded) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
else
task.execute();
} else {
CheckDBReadyTask tempTask = (CheckDBReadyTask) LNReaderApplication.getInstance().getTask(key);
if (tempTask != null) {
task = tempTask;
task.owner = this;
}
}
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.setMessage("Checking...");
alertDialogBuilder.setCancelable(false);
dialog = alertDialogBuilder.create();
dialog.setTitle("Checking DB access");
dialog.setCanceledOnTouchOutside(false);
dialog.show();
}
代码示例来源:origin: ruuvi/com.ruuvi.station
private void requestPermissions() {
if (getNeededPermissions().size() > 0) {
final AppCompatActivity activity = this;
AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create();
alertDialog.setTitle(getString(R.string.permission_dialog_title));
alertDialog.setMessage(getString(R.string.permission_dialog_request_message));
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, getString(R.string.ok),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
showPermissionDialog(activity);
}
});
alertDialog.show();
}
}
代码示例来源:origin: thuetz/Energize
@Override
public void onClick(View v) {
AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create();
alertDialog.setTitle(R.string.alertdialog_not_via_playstore_title);
alertDialog.setMessage(getString(R.string.alertdialog_not_via_playstore_text));
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, getString(R.string.alertdialog_not_via_playstore_button_go_to_playstore),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
MainActivity.this.startPlayStore();
disableGooglePlayWarning();
}
});
alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE, getString(R.string.alertdialog_not_via_playstore_button_dismiss),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
disableGooglePlayWarning();
}
});
alertDialog.show();
}
});
代码示例来源:origin: GoldenKappa/notSABS
if (blackTheme) {
AlertDialog alertDialog = new AlertDialog.Builder(Objects.requireNonNull(getContext()), R.style.BlackAppThemeDialog).create();
alertDialog.setTitle(getString(R.string.restore_permissions));
alertDialog.setMessage(getString(R.string.restore_permissions_message));
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "Yes",
alertDialog.setTitle(getString(R.string.restore_permissions));
alertDialog.setMessage(getString(R.string.restore_permissions_message));
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "Yes",
代码示例来源:origin: kshoji/BLE-HID-Peripheral-for-Android
alertDialog.setTitle(getString(string.not_supported));
alertDialog.setMessage(getString(string.ble_perip_not_supported));
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, getString(string.ok),
代码示例来源:origin: woxingxiao/GracefulMovies
});
if (!AndPermission.hasPermissions(this, Manifest.permission.ACCESS_FINE_LOCATION)) {
dialog.setTitle("定位权限");
dialog.setMessage("为了准确获取所在地的数据,请授予定位权限!\n设置:权限管理->定位");
dialog.show();
dialog.setTitle("手机状态权限");
dialog.setMessage("为保证应用正常工作,请授予手机状态权限!\n设置:权限管理->手机");
dialog.show();
dialog.setTitle("外部存储权限");
dialog.setMessage("为保证应用正常工作,请授予外部存储权限!\n设置:权限管理->存储");
dialog.show();
dialog.setCancelable(false);
if (!AndPermission.hasPermissions(this, Manifest.permission.ACCESS_FINE_LOCATION)) {
dialog.setTitle("定位权限");
dialog.setMessage("为了准确获取所在地的数据,请授予定位权限!");
dialog.show();
dialog.setTitle("手机状态权限");
dialog.setMessage("为保证应用正常工作,请授予手机状态权限!");
dialog.show();
dialog.setTitle("外部存储权限");
dialog.setMessage("为保证应用正常工作,请授予外部存储权限!");
dialog.show();
代码示例来源:origin: kshoji/BLE-HID-Peripheral-for-Android
alertDialog.setTitle(getString(string.not_supported));
alertDialog.setMessage(getString(string.ble_perip_not_supported));
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, getString(string.ok),
内容来源于网络,如有侵权,请联系作者删除!