Example usage for android.app AlertDialog.Builder setMessage

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

Introduction

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

Prototype

public void setMessage(CharSequence message) 

Source Link

Usage

From source file:com.spoiledmilk.ibikecph.map.MapActivity.java

private void launchLoginDialog() {
    if (loginDlg == null) {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(IbikeApplication.getString("login"));
        builder.setMessage(IbikeApplication.getString("error_not_logged_in"));
        builder.setPositiveButton(IbikeApplication.getString("login"), new DialogInterface.OnClickListener() {

            @Override/*www .j  a  v a 2  s .  c  om*/
            public void onClick(DialogInterface dialog, int which) {
                Intent i = new Intent(MapActivity.this, LoginActivity.class);
                startActivity(i);
            }
        });
        builder.setNegativeButton(IbikeApplication.getString("close"), new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });
        loginDlg = builder.create();
    }
    loginDlg.show();
}

From source file:com.entertailion.android.dial.ServerFinder.java

private AlertDialog buildNoWifiDialog() {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);

    builder.setMessage(R.string.finder_wifi_not_available);
    builder.setCancelable(false);//  w w w  .  j  a v  a2s .  c o  m
    builder.setPositiveButton(R.string.finder_configure, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialogInterface, int id) {
            Intent intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
            startActivityForResult(intent, CODE_WIFI_SETTINGS);
        }
    });
    builder.setNegativeButton(R.string.finder_cancel, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialogInterface, int id) {
            setResult(RESULT_CANCELED, null);
            finish();
        }
    });
    return builder.create();
}

From source file:com.googlecode.android_scripting.facade.AndroidFacade.java

private String getInputFromAlertDialog(final String title, final String message, final boolean password) {
    final FutureActivityTask<String> task = new FutureActivityTask<String>() {
        @Override/*from   ww w. ja  v a2  s . c o m*/
        public void onCreate() {
            super.onCreate();
            final EditText input = new EditText(getActivity());
            if (password) {
                input.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
                input.setTransformationMethod(new PasswordTransformationMethod());
            }
            AlertDialog.Builder alert = new AlertDialog.Builder(getActivity());
            alert.setTitle(title);
            alert.setMessage(message);
            alert.setView(input);
            alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int whichButton) {
                    dialog.dismiss();
                    setResult(input.getText().toString());
                    finish();
                }
            });
            alert.setOnCancelListener(new DialogInterface.OnCancelListener() {
                public void onCancel(DialogInterface dialog) {
                    dialog.dismiss();
                    setResult(null);
                    finish();
                }
            });
            alert.show();
        }
    };
    mTaskQueue.execute(task);

    try {
        return task.getResult();
    } catch (Exception e) {
        Log.e("Failed to display dialog.", e);
        throw new RuntimeException(e);
    }
}

From source file:net.evecom.android.log.DailyLogLookActivity.java

/**
 * /*from  w w  w  .ja v  a2  s .c o  m*/
 * 
 * @param errorMsg
 */
private void DialogToast(String errorMsg) {
    AlertDialog.Builder builder1 = new AlertDialog.Builder(DailyLogLookActivity.this);
    builder1.setTitle("");
    builder1.setIcon(R.drawable.qq_dialog_default_icon);// 
    builder1.setMessage("" + errorMsg);
    builder1.setPositiveButton("", new DialogInterface.OnClickListener() {
        // @Override
        public void onClick(DialogInterface dialog, int which) {
        }
    });
    builder1.show();
}

From source file:com.entertailion.android.dial.ServerFinder.java

private AlertDialog buildTimeoutDialog(CharSequence message, DialogInterface.OnClickListener retryListener) {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);

    return builder.setMessage(message).setCancelable(false)
            .setPositiveButton(R.string.finder_manual, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialogInterface, int id) {
                    buildManualIpDialog().show();
                }//from w w  w.  j  av  a 2  s  .com
            }).setNegativeButton(R.string.finder_cancel, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialogInterface, int id) {
                    setResult(RESULT_CANCELED, null);
                    finish();
                }
            }).create();
}

From source file:de.ub0r.android.callmeter.ui.prefs.Preferences.java

/**
 * Reset internal Logs.//w  w  w  .  j  a v a 2  s.  c  om
 */
private void resetDataDialog() {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setTitle(R.string.reset_data_);
    builder.setMessage(R.string.reset_data_hint);
    builder.setCancelable(false);
    builder.setPositiveButton(android.R.string.yes, new OnClickListener() {
        @Override
        public void onClick(final DialogInterface dialog, final int which) {
            Preferences.this.resetData(DataProvider.TYPE_CALL);
            Preferences.this.resetData(DataProvider.TYPE_SMS);
            Preferences.this.resetData(DataProvider.TYPE_MMS);
        }
    });
    builder.setNeutralButton(R.string.reset_data_data_, new OnClickListener() {
        @Override
        public void onClick(final DialogInterface dialog, final int which) {
            Preferences.this.resetData(-1);
        }
    });
    builder.setNegativeButton(android.R.string.no, null);
    builder.show();
}

From source file:net.evecom.android.log.DailyLogLookActivity.java

/**
 * //from   ww w.  j  ava 2  s. co  m
 * 
 * @param v
 */
public void daily_log_more_delete(View v) {

    final AlertDialog.Builder builder = new AlertDialog.Builder(DailyLogLookActivity.this);
    builder.setTitle("");
    builder.setIcon(R.drawable.qq_dialog_default_icon);// 
    builder.setMessage("");
    builder.setPositiveButton("", new DialogInterface.OnClickListener() {
        // @Override
        public void onClick(DialogInterface dialog, int which) {
            progressDialog = ProgressDialog.show(DailyLogLookActivity.this, "", "...");

            formSubmit1();

        }
    });
    builder.setNegativeButton("", new DialogInterface.OnClickListener() {
        // @Override
        public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();
        }
    });
    builder.show();

}

From source file:net.evecom.android.log.DailyLogLookActivity.java

/**
 * fh//from w w  w .  j  av a  2  s  .c  o m
 * 
 * @param v
 */
public void logfh(View v) {

    final AlertDialog.Builder builder = new AlertDialog.Builder(DailyLogLookActivity.this);
    builder.setTitle("");
    builder.setIcon(R.drawable.qq_dialog_default_icon);// 
    builder.setMessage("");
    builder.setPositiveButton("", new DialogInterface.OnClickListener() {
        // @Override
        public void onClick(DialogInterface dialog, int which) {
            DailyLogLookActivity.this.finish();
            Intent intent = new Intent(getApplicationContext(), DailyLogListActivity.class);
            startActivity(intent);

        }
    });
    builder.setNegativeButton("", new DialogInterface.OnClickListener() {
        // @Override
        public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();
        }
    });
    builder.show();

}

From source file:net.evecom.androidecssp.base.BaseActivity.java

/**
 * /*from  ww w . j a v a  2 s. com*/
 * 
 * @param errorMsg
 */
protected void dialogToastNoCall(String errorMsg) {
    AlertDialog.Builder builder1 = new AlertDialog.Builder(this);
    builder1.setTitle("");
    builder1.setIcon(R.drawable.qq_dialog_default_icon);// 
    builder1.setMessage("" + errorMsg);
    builder1.setPositiveButton("", new DialogInterface.OnClickListener() {
        // @Override
        public void onClick(DialogInterface dialog, int which) {

        }
    });
    builder1.show();
}