List of usage examples for android.app AlertDialog.Builder setTitle
@Override public void setTitle(CharSequence title)
From source file:net.dahanne.android.regalandroid.tasks.LoginTask.java
private void showAlert(String message) { AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle(R.string.problem).setMessage(message).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override//from ww w.j a v a2 s. c om public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alert = builder.create(); alert.show(); }
From source file:com.dipesan.miniatm.miniatm.services.RiskManagementTask.java
@Override public void execute(ITaskMonitor monitor) { this.monitor = monitor; activity.runOnUiThread(new Runnable() { @Override// www .ja v a 2 s. c o m public void run() { AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle("Risk management"); builder.setCancelable(false); builder.setMessage("Is card stolen ?"); builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); end(new byte[] { 0, 0b10000, 0, 0, 0 }); } }); builder.setNegativeButton("No", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); end(new byte[] { 0, 0, 0, 0, 0 }); } }); builder.create().show(); } }); }
From source file:com.dragon4.owo.ar_trace.ARCore.MixState.java
public void DialogSelectOption(final MixContext ctx, final String markerTitle, final PhysicalPlace log, final String onPress) { final String items[] = { "? ", "?" }; AlertDialog.Builder ab = new AlertDialog.Builder(ctx); ab.setTitle(markerTitle); ab.setItems(items, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // ? Toast.makeText(ctx, items[id] + " ?.", Toast.LENGTH_SHORT).show(); dialog.dismiss();/*www .java 2 s . c o m*/ if (id == 0) { try { ctx.loadMixViewWebPage(onPress); } catch (Exception e) { } } else if (id == 1) { Navigator navigator = Navigator.getNavigator(); if (navigator != null) navigator.run(log.getLatitude(), log.getLongitude()); else Toast.makeText(ctx, "? ? .", Toast.LENGTH_LONG).show(); } } }); // ? ? AlertDialog alertDialog = ab.create(); // ? alertDialog.show(); }
From source file:appathon.history.PickerActivity.java
private void onError(String error, final boolean finishActivity) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("error_dialog_title").setMessage(error).setPositiveButton("error_dialog_button_text", new DialogInterface.OnClickListener() { @Override/*from w w w .j a v a 2s .c o m*/ public void onClick(DialogInterface dialogInterface, int i) { if (finishActivity) { finishActivity(); } } }); builder.show(); }
From source file:de.thecamper.android.androidtools.UpdateChecker.java
/** * show a AlertDialog to inform the user of the update and let him download * the new version of the app//from w ww .j a va 2s. co m */ public void showUpdateAlert() { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(context.getString(R.string.updateTitle)); builder.setMessage(context.getString(R.string.updateAvailable)); builder.setCancelable(false); builder.setPositiveButton(context.getString(R.string.yes), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(appURL)); context.startActivity(intent); ((Activity) context).finish(); } }); builder.setNegativeButton(context.getString(R.string.later), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alert = builder.create(); alert.show(); }
From source file:com.pdftron.pdf.utils.Utils.java
public static void showAlertDialogWithLink(Context context, String message, String title) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage(Html.fromHtml(message)).setCancelable(true).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override/*ww w.ja v a 2s . com*/ public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); if (title.length() > 0) { builder.setTitle(title); } final AlertDialog d = builder.create(); d.show(); // Make the textview clickable. Must be called after show() ((TextView) d.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance()); }
From source file:tr.com.turkcellteknoloji.turkcellupdater.UpdaterDialogManager.java
@SuppressLint("NewApi") private static View createMessageDialogContentsView(Activity activity, MessageDescription messageDescription) { Context context = activity;//from w w w .jav a2 s. c om final AlertDialog.Builder builder; // Workaround for dialog theme problems if (android.os.Build.VERSION.SDK_INT > 10) { builder = new AlertDialog.Builder(context); context = builder.getContext(); } else { context = new ContextThemeWrapper(context, android.R.style.Theme_Dialog); builder = new AlertDialog.Builder(context); } builder.setTitle("Send feedback"); final LayoutInflater inflater = LayoutInflater.from(context); final View dialogContentsView = inflater.inflate(R.layout.updater_dialog_message, null, false); final TextView textView = (TextView) dialogContentsView.findViewById(R.id.dialog_update_message_text); final ImageView imageView = (ImageView) dialogContentsView.findViewById(R.id.dialog_update_message_image); final ViewSwitcher switcher = (ViewSwitcher) dialogContentsView .findViewById(R.id.dialog_update_message_switcher); String messageText = null; String imageUrl = null; if (messageDescription != null) { messageText = messageDescription.get(MessageDescription.KEY_MESSAGE); imageUrl = messageDescription.get(MessageDescription.KEY_IMAGE_URL); } if (Utilities.isNullOrEmpty(messageText)) { textView.setVisibility(View.GONE); } else { textView.setText(messageText); } if (Utilities.isNullOrEmpty(imageUrl)) { switcher.setVisibility(View.GONE); } else { URI uri; try { uri = new URI(imageUrl); } catch (URISyntaxException e) { uri = null; } if (uri != null) { DownloadRequest request = new DownloadRequest(); request.setUri(uri); request.setDownloadHandler(new DownloadHandler() { @Override public void onSuccess(byte[] result) { // Load image from byte array final Bitmap bitmap = BitmapFactory.decodeByteArray(result, 0, result.length); imageView.setImageBitmap(bitmap); // Hide progress bar and display image if (switcher != null) { switcher.setDisplayedChild(1); } } @Override public void onProgress(Integer percent) { } @Override public void onFail(Exception ex) { Log.e("Message image couldn't be loaded", ex); } @Override public void onCancelled() { } }); HttpClient client = Utilities.createClient("Turkcell Updater/1.0 ", false); try { request.executeAsync(client); } catch (Exception e) { Log.e("Message image couldn't be loaded", e); } } else { switcher.setVisibility(View.GONE); } } return dialogContentsView; }
From source file:com.dnielfe.manager.dialogs.DirectoryInfoDialog.java
public Dialog onCreateDialog(final Bundle savedInstanceState) { final Activity activity = this.getActivity(); mView = activity.getLayoutInflater().inflate(R.layout.dialog_directory_info, null); final AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle(R.string.dir_info); builder.setView(mView);//ww w .j ava 2 s . c o m builder.setNeutralButton(R.string.ok, null); return builder.create(); }
From source file:de.tudresden.inf.rn.mobilis.groups.overlays.GroupsOverlay.java
@Override protected boolean onTap(int index) { OverlayItem item = mOverlays.get(index); GroupItemInfo gii = groupItemInfos.get(index); LayoutInflater inflater = (LayoutInflater) mainActivity .getSystemService(mainActivity.LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.groups_details_dialog, (ViewGroup) mainActivity.findViewById(R.id.groups_details_layout_root)); TextView text = (TextView) layout.findViewById(R.id.groups_details_text); text.setText(Html.fromHtml("<b>Latitude:</b> " + gii.latitudeE6 / 1E6 + "<br><b>Longitude:</b> " + gii.longitudeE6 / 1E6 + "<br><b>Number of Members:</b> " + gii.memberCount)); //Prepare the Intent for creating a group at this foursquare venue final Intent i = new Intent(mainActivity.getApplicationContext(), GroupInfoActivity.class); i.putExtra("group_id", gii.groupId); String title = gii.name;//from w w w .j a v a 2s . co m if (title == null || title.equals("")) title = " "; AlertDialog.Builder builder = new AlertDialog.Builder(mainActivity); builder.setTitle(title).setView(layout).setIcon(R.drawable.group_marker_24).setCancelable(true) .setPositiveButton("Details", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { mainActivity.startActivity(i); } }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); return true; }
From source file:com.springsource.greenhouse.events.sessions.EventSessionRatingActivity.java
private void showSelectStarRatingDialog() { final CharSequence[] items = { "5 Stars", "4 Stars", "3 Stars", "2 Stars", "1 Star" }; AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Select a Star Value"); builder.setItems(items, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { setRating(5 - item);//from w w w . j a va2 s .c om } }); AlertDialog alert = builder.create(); alert.show(); }