Android AlertDialog Create showMessageDialog(Context context, String title, String strText)

Here you can find the source of showMessageDialog(Context context, String title, String strText)

Description

show Message Dialog

Declaration

public static void showMessageDialog(Context context, String title,
            String strText) 

Method Source Code

//package com.java2s;

import android.app.AlertDialog;

import android.content.Context;
import android.content.DialogInterface;

public class Main {
    public static void showMessageDialog(Context context, String title,
            String strText) {/*from w ww.j a  v  a 2s  .  c o m*/
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle(title);
        builder.setMessage(strText);

        builder.setNeutralButton("OK",
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface arg0, int arg1) {
                        // TODO Auto-generated method stub
                        // Toast.makeText(getActivity(), "Close is clicked", Toast.LENGTH_LONG).show();

                    }
                });
        builder.show(); // To show the AlertDialog
    }
}

Related

  1. manageAlertDialog( final Activity fourerrActivity, final String dialogTitle, final String dialogMessage)
  2. showAlertDialog(Context context, String title, String message, String btnString, DialogInterface.OnClickListener onClickListener)
  3. newYesNoDialog(final Context context, String dialogTitle, String screenMessage, int iconResourceId, OnClickListener listener)
  4. newMessageDialog(final Context context, String dialogTitle, String screenMessage, int iconResourceId)
  5. showAuthenticatedDialog(Context context, String title, String text)
  6. showSingleDialog(Context context, String title, String msg, boolean cancelable)
  7. getInstallationDialog(final Context context)
  8. showDialog(Context context, String title, String message)
  9. makeDialogBox(Context context, String title, String message, String cancleButton, DialogInterface.OnClickListener cancelCallBack, String okayButton, DialogInterface.OnClickListener okayCallBack)