本文整理汇总了Java中android.app.AlertDialog.Builder.setMessage方法的典型用法代码示例。如果您正苦于以下问题:Java Builder.setMessage方法的具体用法?Java Builder.setMessage怎么用?Java Builder.setMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.AlertDialog.Builder
的用法示例。
在下文中一共展示了Builder.setMessage方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDialog
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
public static Dialog createDialog(Context context, Bundle arguments, OnClickListener onClickListener) {
Builder builder = new Builder(context);
builder.setTitle(arguments.getString(ErrorDialogManager.KEY_TITLE));
builder.setMessage(arguments.getString(ErrorDialogManager.KEY_MESSAGE));
if (ERROR_DIALOG_ICON != 0) {
builder.setIcon(ERROR_DIALOG_ICON);
}
builder.setPositiveButton(17039370, onClickListener);
return builder.create();
}
示例2: a
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
public static Dialog a(Context context, String str, String str2, String str3, OnClickListener onClickListener, String str4, OnClickListener onClickListener2) {
Builder builder = new Builder(context);
if (a) {
if (!(TextUtils.isEmpty(str4) || onClickListener2 == null)) {
builder.setPositiveButton(str4, onClickListener2);
}
if (!(TextUtils.isEmpty(str3) || onClickListener == null)) {
builder.setNegativeButton(str3, onClickListener);
}
} else {
if (!(TextUtils.isEmpty(str3) || onClickListener == null)) {
builder.setPositiveButton(str3, onClickListener);
}
if (!(TextUtils.isEmpty(str4) || onClickListener2 == null)) {
builder.setNegativeButton(str4, onClickListener2);
}
}
builder.setTitle(str);
builder.setMessage(str2);
Dialog create = builder.create();
create.setCanceledOnTouchOutside(false);
create.setOnKeyListener(new e());
try {
create.show();
} catch (Throwable th) {
}
return create;
}
示例3: showAlert
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
public static AlertDialog showAlert(final Context context, final String msg, final String title) {
if (context instanceof Activity && ((Activity) context).isFinishing()) {
return null;
}
final Builder builder = new AlertDialog.Builder(context);
builder.setIcon(R.drawable.ic_dialog_alert);
builder.setTitle(title);
builder.setMessage(msg);
builder.setPositiveButton(R.string.app_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
dialog.cancel();
}
});
final AlertDialog alert = builder.create();
alert.show();
return alert;
}
示例4: noNetworkDialog
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
private void noNetworkDialog(){
Builder dialogNoNetwork;
dialogNoNetwork = new AlertDialog.Builder(this);
dialogNoNetwork.setCancelable(true);
dialogNoNetwork.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
finish();
}
});
dialogNoNetwork.setTitle(R.string.nonetwork_title);
dialogNoNetwork.setMessage(getString(R.string.nonetwork_message));
dialogNoNetwork.show();
}
示例5: showDeleteHistoryConfirmation
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
private void showDeleteHistoryConfirmation() {
Builder builder = new Builder(getParentActivity());
builder.setMessage(LocaleController.getString("AreYouSureDeleteChanges", R.string.AreYouSureDeleteChanges));
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new C20941());
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
showDialog(builder.create());
}
示例6: run
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
@Override
public void run() {
Builder builder = new Builder(InCallActivity.this);
Resources r = getResources();
builder.setTitle("ZRTP supported by remote party");
builder.setMessage("Do you confirm the SAS : " + sasString);
builder.setPositiveButton(r.getString(R.string.yes), this);
builder.setNegativeButton(r.getString(R.string.no), this);
AlertDialog backupDialog = builder.create();
backupDialog.show();
}
示例7: showDialog
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
public static void showDialog(Activity context, String strTitle, String strText, int icon) {
if (context != null && !context.isFinishing() && !context.isRestricted()) {
Builder tDialog = new Builder(context);
tDialog.setIcon(icon);
tDialog.setTitle(strTitle);
tDialog.setMessage(strText);
tDialog.setPositiveButton(R.string.Ensure, null);
try {
tDialog.show();
} catch (Exception e) {
}
}
}
示例8: getCommonStructure
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
public static Dialog getCommonStructure(final Context context, String messageStr,
DialogInterface.OnClickListener positiveListener) {
Builder builder = new Builder(context);
builder.setMessage(messageStr);
builder.setPositiveButton(R.string.yes_button_txt, positiveListener)
.setNegativeButton(R.string.no_button_txt, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
return builder.create();
}
示例9: showError
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
/**
* Show a visual error message to the user.
*
* @param message
* the message to show
*/
private void showError(String message) {
final Builder builder = new AlertDialog.Builder(AlbumListActivity.this);
builder.setTitle(message);
builder.setIcon(android.R.drawable.ic_dialog_alert);
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.setMessage(message);
builder.show();
}
示例10: showAlert
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
public static void showAlert(Context context, String title, String text) {
Builder alertBuilder = new Builder(context);
alertBuilder.setTitle(title);
alertBuilder.setMessage(text);
alertBuilder.create().show();
}
示例11: showAlert
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
public static void showAlert(Context context, String str, String str2) {
Builder builder = new Builder(context);
builder.setTitle(str);
builder.setMessage(str2);
builder.create().show();
}
示例12: showAlert
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
/**
* Display a simple alert dialog with the given text and title.
*
* @param context
* Android context in which the dialog should be displayed
* @param title
* Alert dialog title
* @param text
* Alert dialog message
*/
@Deprecated
public static void showAlert(Context context, String title, String text) {
Builder alertBuilder = new Builder(context);
alertBuilder.setTitle(title);
alertBuilder.setMessage(text);
alertBuilder.create().show();
}