本文整理汇总了Java中android.app.Dialog.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java Dialog.setTitle方法的具体用法?Java Dialog.setTitle怎么用?Java Dialog.setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.Dialog
的用法示例。
在下文中一共展示了Dialog.setTitle方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initView
import android.app.Dialog; //导入方法依赖的package包/类
protected void initView() {
gridView = (GridView) findViewById(R.id.gridview);
photo_delete = (ImageView) findViewById(R.id.photo_delete);
photo_choose = (ImageView) findViewById(R.id.photo_choose);
gridView.setSelector(new ColorDrawable(Color.TRANSPARENT));
if (type == VIDEOTYPE) {
adapter = new ImageGridAdapter(ImageGridActivity.this, null, videoList,
mHandler, type);
} else {
adapter = new ImageGridAdapter(ImageGridActivity.this, dataList, null,
mHandler, type);
}
dialog = new Dialog(this);
dialog.setCancelable(false);
dialog.setCanceledOnTouchOutside(false);
dialog.setTitle("数据上传");
View view = View.inflate(this, R.layout.customerdialogcheckroll, null);
bar = (ProgressBar) view.findViewById(R.id.customerdialog_pb);
tip = (TextView) view.findViewById(R.id.customerdialog_tv);
dialog.setContentView(view);
gridView.setAdapter(adapter);
}
示例2: optionLegend
import android.app.Dialog; //导入方法依赖的package包/类
private void optionLegend() {
// Show help
Dialog dialog = new Dialog(ActivityApp.this);
dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON);
dialog.setTitle(R.string.menu_legend);
dialog.setContentView(R.layout.legend);
dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, getThemed(R.attr.icon_launcher));
((ImageView) dialog.findViewById(R.id.imgHelpHalf)).setImageBitmap(getHalfCheckBox());
((ImageView) dialog.findViewById(R.id.imgHelpOnDemand)).setImageBitmap(getOnDemandCheckBox());
for (View child : Util.getViewsByTag((ViewGroup) dialog.findViewById(android.R.id.content), "main"))
child.setVisibility(View.GONE);
((LinearLayout) dialog.findViewById(R.id.llUnsafe)).setVisibility(PrivacyManager.cVersion3 ? View.VISIBLE
: View.GONE);
dialog.setCancelable(true);
dialog.show();
}
示例3: optionLegend
import android.app.Dialog; //导入方法依赖的package包/类
private void optionLegend() {
// Show help
Dialog dialog = new Dialog(ActivityMain.this);
dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON);
dialog.setTitle(R.string.menu_legend);
dialog.setContentView(R.layout.legend);
dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, getThemed(R.attr.icon_launcher));
((ImageView) dialog.findViewById(R.id.imgHelpHalf)).setImageBitmap(getHalfCheckBox());
((ImageView) dialog.findViewById(R.id.imgHelpOnDemand)).setImageBitmap(getOnDemandCheckBox());
for (View child : Util.getViewsByTag((ViewGroup) dialog.findViewById(android.R.id.content), "details"))
child.setVisibility(View.GONE);
((LinearLayout) dialog.findViewById(R.id.llUnsafe)).setVisibility(PrivacyManager.cVersion3 ? View.VISIBLE
: View.GONE);
dialog.setCancelable(true);
dialog.show();
}
示例4: optionTutorial
import android.app.Dialog; //导入方法依赖的package包/类
private void optionTutorial() {
((ScrollView) findViewById(R.id.svTutorialHeader)).setVisibility(View.VISIBLE);
((ScrollView) findViewById(R.id.svTutorialDetails)).setVisibility(View.VISIBLE);
int userId = Util.getUserId(Process.myUid());
PrivacyManager.setSetting(userId, PrivacyManager.cSettingTutorialMain, Boolean.FALSE.toString());
Dialog dlgUsage = new Dialog(this);
dlgUsage.requestWindowFeature(Window.FEATURE_LEFT_ICON);
dlgUsage.setTitle(R.string.title_usage_header);
dlgUsage.setContentView(R.layout.usage);
dlgUsage.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, getThemed(R.attr.icon_launcher));
dlgUsage.setCancelable(true);
dlgUsage.show();
}
示例5: createDialog
import android.app.Dialog; //导入方法依赖的package包/类
public static Dialog createDialog(Context context, String title, String buttonTitle){
final Dialog dialog=new Dialog(context);
dialog.setTitle(title);
dialog.setCancelable(false);
dialog.setContentView(R.layout.create_file_dialog);
dialog.show();
((Button) dialog.findViewById(R.id.create_file_button)).setText(buttonTitle);
dialog.findViewById(R.id.cancel_file_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
return dialog;
}
示例6: showAboutDialog
import android.app.Dialog; //导入方法依赖的package包/类
public void showAboutDialog()
{
Dialog dialog = new Dialog(this);
/*dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);*/
LinearLayout mDialogLayout = new LinearLayout(this);
TextView mTextView = new TextView(this);
mTextView.setPadding(20, 0, 20, 20);
mTextView.setLineSpacing(8, 1);
mTextView.setText(Html.fromHtml(
"<p>" +
"Author: Rémy Böhler<br />" +
"E-Mail: [email protected]" +
"</p>" +
"Version: 0.2<br />" +
"License: GPLv3<br />" +
"Source: github.com/rrelmy/BatteryLevel"
));
// TODO better way for that?
// link mail
Pattern patternMail = Pattern.compile("[email protected]");
Linkify.addLinks(mTextView, patternMail, "mailto://");
// link source link
Pattern patternLink = Pattern.compile("github.com/rrelmy/BatteryLevel");
Linkify.addLinks(mTextView, patternLink, "https://");
mDialogLayout.addView(mTextView);
dialog.setContentView(mDialogLayout);
dialog.setTitle("About");
dialog.show();
}
示例7: onCreateDialog
import android.app.Dialog; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View inflate = inflater.inflate(R.layout.sorting_options, null);
ButterKnife.bind(this, inflate);
initView();
Dialog dialog = new Dialog(getActivity());
dialog.setContentView(inflate);
dialog.setTitle("Sort By");
dialog.show();
return dialog;
}
示例8: doCaptureKey
import android.app.Dialog; //导入方法依赖的package包/类
public Dialog doCaptureKey(){
final Dialog d = new Dialog(_gamePadActivity);
d.setContentView(R.layout.prefs_capture_key);
d.setCanceledOnTouchOutside(true);
d.setOnKeyListener(new Dialog.OnKeyListener() {
@Override
public boolean onKey(DialogInterface arg0, int keyCode,
KeyEvent event) {
_setActionKey(keyCode);
d.dismiss();
return true;
}
});
Button b = (Button)d.findViewById(R.id.buttonResetToDefault);
b.setOnClickListener(new Button.OnClickListener(){
@Override
public void onClick(View v) {
switch(_captureKey){
case PICK_UP: _setActionKey(KeyEvent.KEYCODE_BUTTON_Y); break;
case JUMP: _setActionKey(KeyEvent.KEYCODE_BUTTON_A); break;
case PUNCH: _setActionKey(KeyEvent.KEYCODE_BUTTON_X); break;
case BOMB: _setActionKey(KeyEvent.KEYCODE_BUTTON_B); break;
case RUN1: _setActionKey(KeyEvent.KEYCODE_BUTTON_L1); break;
case RUN2: _setActionKey(KeyEvent.KEYCODE_BUTTON_R1); break;
case START: _setActionKey(KeyEvent.KEYCODE_BUTTON_START); break;
default:
LogThread.log("Error: unrecognized key in doActionKey",null);
break;
}
d.dismiss();
}});
d.setTitle(R.string.capturing);
d.show();
return d;
}
示例9: AddDoctor
import android.app.Dialog; //导入方法依赖的package包/类
public void AddDoctor(View view) {
final Dialog dialog = new Dialog(DoctorActivity.this);
dialog.setTitle("Add Doctor");
dialog.setContentView(R.layout.doctor_dialog);
Button button = (Button) dialog.findViewById(R.id.add_doctor);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
//edit text
EditText name =(EditText)dialog.findViewById(R.id.name);
EditText surname =(EditText)dialog.findViewById(R.id.surname);
EditText address =(EditText)dialog.findViewById(R.id.address);
EditText phone =(EditText)dialog.findViewById(R.id.phone);
//get text
String task = name.getText().toString();
String task2 = surname.getText().toString();
String task3 = address.getText().toString();
String task4 = phone.getText().toString();
SQLiteDatabase db = mHelper.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(DoctorContract.TaskEntry.DOCTOR_NAME, task);
db.insertWithOnConflict(DoctorContract.TaskEntry.TABLE,
null,
values,
SQLiteDatabase.CONFLICT_REPLACE);
db.close();
//refresh listview
updateUI();
dialog.dismiss();
}
});
dialog.show();
}
示例10: showHelp
import android.app.Dialog; //导入方法依赖的package包/类
@SuppressLint("InflateParams")
public static void showHelp(ActivityBase context, View parent, Hook hook) {
// Build dialog
Dialog dlgHelp = new Dialog(context);
dlgHelp.requestWindowFeature(Window.FEATURE_LEFT_ICON);
dlgHelp.setTitle(R.string.app_name);
dlgHelp.setContentView(R.layout.helpfunc);
dlgHelp.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, context.getThemed(R.attr.icon_launcher));
dlgHelp.setCancelable(true);
// Set title
TextView tvTitle = (TextView) dlgHelp.findViewById(R.id.tvTitle);
tvTitle.setText(hook.getName());
// Set info
TextView tvInfo = (TextView) dlgHelp.findViewById(R.id.tvInfo);
tvInfo.setText(Html.fromHtml(hook.getAnnotation()));
tvInfo.setMovementMethod(LinkMovementMethod.getInstance());
// Set permissions
String[] permissions = hook.getPermissions();
if (permissions != null && permissions.length > 0)
if (!permissions[0].equals("")) {
TextView tvPermissions = (TextView) dlgHelp.findViewById(R.id.tvPermissions);
tvPermissions.setText(Html.fromHtml(TextUtils.join("<br />", permissions)));
}
dlgHelp.show();
}
示例11: onCreateDialog
import android.app.Dialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Dialog d = super.onCreateDialog(savedInstanceState);
d.setTitle(null);
return d;
}
示例12: doHardwareControlsPrefs
import android.app.Dialog; //导入方法依赖的package包/类
public void doHardwareControlsPrefs() {
final Dialog d = new Dialog(_gamePadActivity);
d.setContentView(R.layout.prefs_hardware_controls);
d.setCanceledOnTouchOutside(true);
Button.OnClickListener l =
new Button.OnClickListener(){
@Override
public void onClick(View v) {
// take note of which action this capture will apply to, then launch a capture..
if (v == d.findViewById(R.id.buttonPickUp)) _captureKey = CaptureKey.PICK_UP;
else if (v == d.findViewById(R.id.buttonJump)) _captureKey = CaptureKey.JUMP;
else if (v == d.findViewById(R.id.buttonPunch)) _captureKey = CaptureKey.PUNCH;
else if (v == d.findViewById(R.id.buttonBomb)) _captureKey = CaptureKey.BOMB;
else if (v == d.findViewById(R.id.buttonRun1)) _captureKey = CaptureKey.RUN1;
else if (v == d.findViewById(R.id.buttonRun2)) _captureKey = CaptureKey.RUN2;
else if (v == d.findViewById(R.id.buttonStart)) _captureKey = CaptureKey.START;
else LogThread.log("Error: unrecognized capture button",null);
Dialog d2 = doCaptureKey();
d2.setOnDismissListener(new Dialog.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
_updateHardwareControlsLabels(d);
}
});
}};
d.findViewById(R.id.buttonPickUp).setOnClickListener(l);
d.findViewById(R.id.buttonJump).setOnClickListener(l);
d.findViewById(R.id.buttonPunch).setOnClickListener(l);
d.findViewById(R.id.buttonBomb).setOnClickListener(l);
d.findViewById(R.id.buttonRun1).setOnClickListener(l);
d.findViewById(R.id.buttonRun2).setOnClickListener(l);
d.findViewById(R.id.buttonStart).setOnClickListener(l);
d.setTitle(R.string.configHardwareButtons);
_updateHardwareControlsLabels(d);
d.show();
}