Example usage for android.app AlertDialog setMessage

List of usage examples for android.app AlertDialog setMessage

Introduction

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

Prototype

public void setMessage(CharSequence message) 

Source Link

Usage

From source file:eu.betaas.betaasandroidapp.NavigationDrawerFragment.java

@Override
public void onGatewayInstallFailure(Gateway gateway, String cause) {
    AlertDialog alertDialog = new AlertDialog.Builder(this.getActivity()).create();
    alertDialog.setTitle("Alert");
    alertDialog.setMessage("[" + gateway.getName() + "] : " + cause);
    alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();//from  w  w  w .  j  a v  a2  s  . co m
        }
    });
    alertDialog.show();
}

From source file:eu.betaas.betaasandroidapp.NavigationDrawerFragment.java

@Override
public void onGatewayUpdateFailure(Gateway gateway, String cause) {
    AlertDialog alertDialog = new AlertDialog.Builder(this.getActivity()).create();
    alertDialog.setTitle("Alert");
    alertDialog.setMessage("[" + gateway.getName() + "] : " + cause);
    alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();//from   w  w w.  j  a  v  a2 s. c  om
        }
    });
    alertDialog.show();
}

From source file:eu.betaas.betaasandroidapp.NavigationDrawerFragment.java

@Override
public void onGatewayRemoveFailure(Gateway gateway, String cause) {
    AlertDialog alertDialog = new AlertDialog.Builder(this.getActivity()).create();
    alertDialog.setTitle("Alert");
    alertDialog.setMessage("[" + gateway.getName() + "] : " + cause);
    alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();/*  w ww. ja va  2 s  . c  o m*/
        }
    });
    alertDialog.show();
}

From source file:org.adaway.ui.BlacklistFragment.java

/**
 * Add new entry based on input/*from w  ww  .  ja va 2 s.c om*/
 * 
 * @param input
 */
private void addEntry(String input) {
    if (input != null) {
        if (RegexUtils.isValidHostname(input)) {
            ProviderHelper.insertBlacklistItem(mActivity, input);
        } else {
            AlertDialog alertDialog = new AlertDialog.Builder(mActivity).create();
            alertDialog.setIcon(android.R.drawable.ic_dialog_alert);
            alertDialog.setTitle(R.string.no_hostname_title);
            alertDialog.setMessage(getString(org.adaway.R.string.no_hostname));
            alertDialog.setButton(getString(R.string.button_close), new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dlg, int sum) {
                    dlg.dismiss();
                }
            });
            alertDialog.show();
        }
    }
}

From source file:org.adaway.ui.WhitelistFragment.java

/**
 * Add new entry based on input//from  w  w w  .  j  av  a 2 s  . c o m
 *
 * @param input
 */
private void addEntry(String input) {
    if (input != null) {
        if (RegexUtils.isValidWhitelistHostname(input)) {
            ProviderHelper.insertWhitelistItem(mActivity, input);
        } else {
            AlertDialog alertDialog = new AlertDialog.Builder(mActivity).create();
            alertDialog.setIcon(android.R.drawable.ic_dialog_alert);
            alertDialog.setTitle(R.string.no_hostname_title);
            alertDialog.setMessage(getString(org.adaway.R.string.no_hostname));
            alertDialog.setButton(getString(R.string.button_close), new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dlg, int sum) {
                    dlg.dismiss();
                }
            });
            alertDialog.show();
        }
    }
}

From source file:org.adawaycn.ui.WhitelistFragment.java

/**
 * Add new entry based on input//from  w  ww.j  a  va  2 s  .  co  m
 *
 * @param input
 */
private void addEntry(String input) {
    if (input != null) {
        if (RegexUtils.isValidWhitelistHostname(input)) {
            ProviderHelper.insertWhitelistItem(mActivity, input);
        } else {
            AlertDialog alertDialog = new AlertDialog.Builder(mActivity).create();
            alertDialog.setIcon(android.R.drawable.ic_dialog_alert);
            alertDialog.setTitle(R.string.no_hostname_title);
            alertDialog.setMessage(getString(R.string.no_hostname));
            alertDialog.setButton(getString(R.string.button_close), new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dlg, int sum) {
                    dlg.dismiss();
                }
            });
            alertDialog.show();
        }
    }
}

From source file:org.adawaycn.ui.BlacklistFragment.java

/**
 * Add new entry based on input//from  ww  w .  j a va 2s . com
 *
 * @param input
 */
private void addEntry(String input) {
    if (input != null) {
        if (org.adawaycn.util.RegexUtils.isValidHostname(input)) {
            org.adawaycn.provider.ProviderHelper.insertBlacklistItem(mActivity, input);
        } else {
            AlertDialog alertDialog = new AlertDialog.Builder(mActivity).create();
            alertDialog.setIcon(android.R.drawable.ic_dialog_alert);
            alertDialog.setTitle(R.string.no_hostname_title);
            alertDialog.setMessage(getString(R.string.no_hostname));
            alertDialog.setButton(getString(R.string.button_close), new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dlg, int sum) {
                    dlg.dismiss();
                }
            });
            alertDialog.show();
        }
    }
}

From source file:sssemil.com.hostsaway.ui.HostsSourcesFragment.java

/**
 * Add new entry based on input/*from   w w  w .j av  a  2  s  .  c o  m*/
 *
 * @param input
 */
private void addEntry(String input) {
    if (input != null) {
        if (RegexUtils.isValidUrl(input)) {

            // insert hosts source into database
            ProviderHelper.insertHostsSource(mActivity, input);
        } else {
            AlertDialog alertDialog = new AlertDialog.Builder(mActivity).create();
            alertDialog.setIcon(android.R.drawable.ic_dialog_alert);
            alertDialog.setTitle(R.string.no_url_title);
            alertDialog.setMessage(getString(sssemil.com.hostsaway.R.string.no_url));
            alertDialog.setButton(getString(R.string.button_close), new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dlg, int sum) {
                    dlg.dismiss();
                }
            });
            alertDialog.show();
        }
    }
}

From source file:com.sck.maininterface.PaymentInfo.java

@SuppressWarnings("deprecation")
@Override// w  w  w  .  ja  v  a  2 s . c  o  m
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQUEST_CODE_PAYMENT) {

        if (resultCode == Activity.RESULT_OK) {

            PaymentConfirmation confirm = data.getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);

            if (confirm != null) {

                try {
                    Log.i(TAG, confirm.toJSONObject().toString(4));
                    Log.i(TAG, confirm.getPayment().toJSONObject().toString(4));

                    /*   Toast.makeText(
                             getApplicationContext(),
                             "Payment Confirmation info received from PayPal",
                             Toast.LENGTH_LONG).show();*/

                    AlertDialog ad = new AlertDialog.Builder(this).create();
                    ad.setCancelable(false); // This blocks the 'BACK' button  
                    ad.setMessage("Payment Confirmation info received from PayPal");
                    ad.setButton("OK", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.dismiss();
                        }
                    });
                    ad.show();
                    //new updateExpiryDate().execute();
                    //paymentSuccess=true;
                    saveExpDate(renewedDate);

                } catch (JSONException e) {
                    Log.e(TAG, "an extremely unlikely failure occurred: ", e);
                }
            }
        }

        else if (resultCode == Activity.RESULT_CANCELED) {
            Log.i(TAG, "The user canceled.");
        }

        else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {
            Log.i(TAG, "An invalid Payment or PayPalConfiguration was submitted. Please see the docs.");
        }
    }

    // /

}

From source file:org.adaway.ui.HostsSourcesFragment.java

/**
 * Add new entry based on input/*  w w  w.j  a va2 s.c  o m*/
 *
 * @param input
 */
private void addEntry(String input) {
    if (input != null) {
        if (RegexUtils.isValidUrl(input)) {

            // insert hosts source into database
            ProviderHelper.insertHostsSource(mActivity, input);
        } else {
            AlertDialog alertDialog = new AlertDialog.Builder(mActivity).create();
            alertDialog.setIcon(android.R.drawable.ic_dialog_alert);
            alertDialog.setTitle(R.string.no_url_title);
            alertDialog.setMessage(getString(org.adaway.R.string.no_url));
            alertDialog.setButton(getString(R.string.button_close), new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dlg, int sum) {
                    dlg.dismiss();
                }
            });
            alertDialog.show();
        }
    }
}