本文整理汇总了Java中android.app.AlertDialog.Builder.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java Builder.setTitle方法的具体用法?Java Builder.setTitle怎么用?Java Builder.setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.AlertDialog.Builder
的用法示例。
在下文中一共展示了Builder.setTitle方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
示例3: show
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
public void show(String searchName,ArrayList<String> filePathList){
// タイトル
String strTitle = searchName+"駅を検索";
// リストビュー
ListView listview = new ListView( m_parent );
listview.setScrollingCacheEnabled( false );
listview.setOnItemClickListener( this );
// ファイルリスト
List<FileInfo> listFileInfo = new ArrayList<>();
for( String filePath : filePathList ){
File file=new File(filePath);
if(!file.exists()){
continue;
}
System.out.println(filePath);
if(file.getName().endsWith(".oud")||file.getName().endsWith(".oud2")) {
String[] stationName=loadStartEndStation(file);
listFileInfo.add(new FileInfo(stationName[0]+"~"+stationName[1]+"\n"+file.getName(),file));
}
}
Collections.sort( listFileInfo );
m_fileinfoarrayadapter = new FileInfoArrayAdapter( m_parent, listFileInfo );
listview.setAdapter( m_fileinfoarrayadapter );
Builder builder = new AlertDialog.Builder( m_parent );
builder.setTitle( strTitle );
builder.setNeutralButton("キャンセル", null );
builder.setView( listview );
m_dlg = builder.show();
}
示例4: 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;
}
示例5: uploadHeadPhoto
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
private void uploadHeadPhoto() {
Builder builder = new Builder(this);
builder.setTitle(R.string.dl_title_upload_photo);
builder.setItems(new String[] { getString(R.string.dl_msg_take_photo), getString(R.string.dl_msg_local_upload) },
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
switch (which) {
case 0:
Toast.makeText(UserProfileActivity.this, getString(R.string.toast_no_support),
Toast.LENGTH_SHORT).show();
break;
case 1:
Intent pickIntent = new Intent(Intent.ACTION_PICK,null);
pickIntent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*");
startActivityForResult(pickIntent, REQUESTCODE_PICK);
break;
default:
break;
}
}
});
builder.create().show();
}
示例6: 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();
}
示例7: 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();
}
示例8: 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) {
}
}
}
示例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 str, String str2) {
Builder builder = new Builder(context);
builder.setTitle(str);
builder.setMessage(str2);
builder.create().show();
}
示例11: onPrepareDialogBuilder
import android.app.AlertDialog.Builder; //导入方法依赖的package包/类
@Override
protected void onPrepareDialogBuilder(Builder builder) {
super.onPrepareDialogBuilder(builder);
builder.setTitle(null); // remove dialog title to get more space for color picker
}
示例12: 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();
}
示例13: 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();
}