Example usage for android.app AlertDialog.Builder setTitle

List of usage examples for android.app AlertDialog.Builder setTitle

Introduction

In this page you can find the example usage for android.app AlertDialog.Builder setTitle.

Prototype

@Override
    public void setTitle(CharSequence title) 

Source Link

Usage

From source file:de.da_sense.moses.client.service.MosesService.java

/**
 * This function will be executed on first run and shows some welcome
 * dialog.//w  w w  .  j av a2s  . c  o m
 * 
 * @param context
 *            The context under which the dialog is shown.
 */
private void showWelcomeDialog(final Context context) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);

    builder.setIcon(R.drawable.ic_launcher);
    builder.setCancelable(false); // This blocks the 'BACK' button
    builder.setMessage(getString(R.string.welcome_to_moses_string));
    builder.setTitle(getString(R.string.welcome_to_moses_title_string));
    builder.setNegativeButton("OK", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();
        }
    });
    AlertDialog alert = builder.create();
    alert.show();
    Log.d("MoSeS.SERVICE", "First login.");
    PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean("first_start", false).commit();
}

From source file:com.cleverzone.zhizhi.capture.CaptureActivity.java

private void displayFrameworkBugMessageAndExit() {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setTitle(getString(R.string.app_name));
    builder.setMessage(getString(R.string.msg_camera_framework_bug));
    builder.setPositiveButton(R.string.button_ok, new FinishListener(this));
    builder.setOnCancelListener(new FinishListener(this));
    builder.show();/*from  w  w w  .j a  va 2 s .  c o  m*/
}

From source file:org.hfoss.posit.android.functionplugin.reminder.SetReminder.java

private void showAddrConfirmDialog() {
    // Set the current dialog
    currentDialog = ADDRESS_CONFIRM_DIALOG_ID;

    // Build Address Confirm Dialog
    AlertDialog.Builder addrConfirmBuilder = new AlertDialog.Builder(this);
    addrConfirmBuilder.setTitle("Step 4: Did you mean...");

    // Build the possible addresses list from results returned by Google URL request
    ArrayList<String> possibleAddr = new ArrayList<String>();

    for (int i = 0; i < addressArray.length(); i++) {
        try {//  w  w w  .j  a  va 2s.c o m
            String receivedAddr = addressArray.getJSONObject(i).getString("formatted_address").replace(", ",
                    ",\n");
            possibleAddr.add(receivedAddr);
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    final CharSequence[] possibleAddrChar = possibleAddr.toArray(new CharSequence[possibleAddr.size()]);
    addrConfirmBuilder.setItems(possibleAddrChar, mAddrConfirmOnClickListener);

    // Set Listeners
    addrConfirmBuilder.setOnKeyListener(mBackKeyListener);
    // Re-display Address Enter Dialog when the user presses retry
    addrConfirmBuilder.setPositiveButton("Retry", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            showAddrEnterDialog();
            Toast.makeText(getApplicationContext(),
                    "To get better results, please type a more specific name or address "
                            + "with CITY NAME included.",
                    Toast.LENGTH_LONG).show();
        }
    });
    // Finish the activity when the user presses cancel
    addrConfirmBuilder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            setResult(RESULT_OK);
            finish();
        }
    });

    // Show Address Confirm Dialog
    addrConfirmDialog = addrConfirmBuilder.create();
    addrConfirmDialog.show();
}

From source file:net.evecom.android.web.Web3Activity.java

/**
 * // w ww  .  j av  a 2s  .c o  m
 * 
 * @param v
 */
public void message_post_web_tomain(View v) {
    AlertDialog.Builder builder1 = new AlertDialog.Builder(Web3Activity.this);
    builder1.setTitle("");
    builder1.setIcon(R.drawable.qq_dialog_default_icon);// 
    builder1.setMessage("");
    builder1.setPositiveButton("", new DialogInterface.OnClickListener() {
        // @Override
        public void onClick(DialogInterface dialog, int which) {
            finish();
        }
    });
    builder1.setNegativeButton("", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {

        }
    });
    builder1.show();
}

From source file:aarddict.android.ArticleViewActivity.java

private void showError(final String message) {
    runOnUiThread(new Runnable() {
        public void run() {
            currentTask = null;//from w  ww.jav  a  2 s  .  co  m
            setProgress(10000);
            resetTitleToCurrent();
            AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(ArticleViewActivity.this);
            dialogBuilder.setTitle(R.string.titleError).setMessage(message)
                    .setNeutralButton(R.string.btnDismiss, new OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.dismiss();
                            if (backItems.isEmpty()) {
                                finish();
                            }
                        }
                    });
            dialogBuilder.show();
        }
    });
}