Dialog dialog = new Dialog(this, R.style.PauseDialog); // Setting the title and layout for the dialog dialog.setTitle(R.string.pause_menu_label); dialog.setContentView(R.layout.pause_menu);
public void openDialog() { final Dialog dialog = new Dialog(context); // Context, this, etc. dialog.setContentView(R.layout.dialog_demo); dialog.setTitle(R.string.dialog_title); dialog.show(); }
Dialog dialog = new Dialog(Activity.this); dialog.setContentView(R.layout.list) ListView lv = (ListView ) dialog.findViewById(R.id.lv); dialog.setCancelable(true); dialog.setTitle("ListView"); dialog.show();
// custom dialog final Dialog dialog = new Dialog((Activity) mContext); View layout = ((Activity) mContext).findViewById(R.layout.wish_dialog); dialog.setContentView(R.layout.wish_dialog); dialog.setTitle("Wish"); ImageView image = (ImageView) ((Activity) mContext).findViewById(R.id.image_display); TextView title = (TextView) ((Activity) mContext).findViewById(R.id.title_display); TextView desc = (TextView) ((Activity) mContext).findViewById(R.id.desc_display); TextView loc = (TextView) ((Activity) mContext).findViewById(R.id.loc_display); ..................................
Context mContext = getApplicationContext(); Dialog dialog = new Dialog(mContext); dialog.setContentView(R.layout.custom_dialog); dialog.setTitle("Custom Dialog"); TextView text = (TextView) dialog.findViewById(R.id.text); text.setText("Hello, this is a custom dialog!"); ImageView image = (ImageView) dialog.findViewById(R.id.image); image.setImageResource(R.drawable.android);
public void optionsPressed(MenuItem item){ final Dialog optionsDialog = new Dialog(this); optionsDialog.setTitle("Options"); View dialogView = View.inflate(this, R.layout.options, null); button1 = (Button) dialogView.findViewById(R.id.button1); button1.setOnClickListener(new OnClickListener() { Toast.makeText(getApplicationContext(), "Color selected", Toast.LENGTH_LONG).show(); } optionsDialog .setContentView(dialogView); optionsDialog .show(); }
final Dialog dialog = new Dialog(this); dialog.setContentView(R.layout.custom_dialog); dialog.setTitle("Custom Alert Dialog"); final EditText editText = (EditText) dialog.findViewById(R.id.editText); Button btnSave = (Button) dialog.findViewById(R.id.save); Button btnCancel = (Button) dialog.findViewById(R.id.cancel); dialog.show();
Dialog dialog = new Dialog(context); dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON); dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.your_icon); dialog.setContentView(R.layout.custom_dialog); dialog.setTitle("Dialog Title"); dialog.show();
// Create custom dialog object final Dialog dialog = new Dialog(this); dialog.setContentView(R.layout.customdialog); // Set dialog title dialog.setTitle("Custom Dialog"); // here you can get the reference to your Views and do whatever you want with
protected Dialog onCreateDialog(int id) { Dialog dialog; switch(id) { case DIALOG_SEND_PM: dialog = new Dialog(PM.this); dialog.setContentView(R.layout.send_pm_dialog); dialog.setTitle(R.string.send_pm); pmMessage = (EditText) dialog.findViewById(R.id.send_pm_box); Button sendPm = (Button) dialog.findViewById(R.id.send_pm_button); sendPm.setOnClickListener(PM.this); Spinner spinner = (Spinner)dialog.findViewById(R.id.pm_server); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.server_array, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); spinner.setOnItemSelectedListener(new MyOnItemSelectedListener()); break; default: dialog = null; } return dialog; }
Dialog dialog = new Dialog(mContext); dialog.setContentView(R.layout.custom_dialog); dialog.setTitle("Custom Dialog");
Dialog dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON); dialog.setContentView(R.layout.dialog); dialog.setTitle("My great title"); dialog.setCancelable(true); dialog.show(); dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.icon); WebView vw = (WebView) dialog.findViewById(R.id.wv);
Dialog dialog = new Dialog(context); dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON); dialog.setContentView(R.layout.custom_dialog); dialog.setTitle("Dialog Title"); dialog.show(); dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.your_icon);
for (;;) { if (paramInt == 2) { final Dialog localDialog2 = new Dialog(this); localDialog2.setContentView(R.layout.multiautotext); localDialog2.setTitle("setcontact"); return super.onCreateDialog(paramInt); } }
final Dialog dialog = new Dialog(context); dialog.setContentView(R.layout.popup_exercise); dialog.setTitle(title); Button add = (Button) dialog.findViewById(R.id.btnAddExer); Button cancel = (Button) dialog.findViewById(R.id.btnCancel);
Dialog pauseDialog = new Dialog(this, R.style.PauseDialog); pauseDialog.setTitle(R.string.pause_menu_label); pauseDialog.setContentView(R.layout.pause_menu);
final Dialog dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON); dialog.setTitle(R.string.my_dialog_title); dialog.setContentView(R.layout.my_dialog_layout); dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,R.drawable.some_icon); dialog.show();
dialog.setTitle("Rate " + APP_TITLE); ll.addView(b3); dialog.setContentView(ll); dialog.show();
for (Your loop Condition) { if (paramInt == 2) { final Dialog localDialog2 = new Dialog(this); localDialog2.setContentView(R.layout.multiautotext); localDialog2.setTitle("setcontact"); return super.onCreateDialog(paramInt); } }