Android AlertDialog Create showInfoDialog(String text, final Context context)

Here you can find the source of showInfoDialog(String text, final Context context)

Description

show Info Dialog

License

Open Source License

Declaration

public static void showInfoDialog(String text, final Context context) 

Method Source Code

//package com.java2s;
/**//from ww w . j  a  va2 s .  c o  m
 * Copyright (c) 2011: mnemr.com contributors. All rights reserved.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published 
 * the Free Software Foundation, either version 3 of the License, 
 * (at your option) any later version.
 *
 * program is distributed in the hope that it will be 
 * but WITHOUT ANY WARRANTY; without even the implied warranty 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See 
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 **/

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;

public class Main {
    public static void showInfoDialog(String text, final Context context) {

        String ok_text = "Ok";

        AlertDialog infoDialog = new AlertDialog.Builder(context)
                .setIcon(android.R.drawable.ic_dialog_info)
                .setItems(null, new OnClickListener() {

                    public void onClick(DialogInterface dialog, int which) {

                    }
                }).setTitle("Info").setMessage(text)
                .setPositiveButton(ok_text, new OnClickListener() {

                    public void onClick(DialogInterface dialog, int which) {

                    }
                }).create();

        infoDialog.show();

    }
}

Related

  1. showDialog(Context context, String title, String message)
  2. makeDialogBox(Context context, String title, String message, String cancleButton, DialogInterface.OnClickListener cancelCallBack, String okayButton, DialogInterface.OnClickListener okayCallBack)
  3. simpleDialogBox(Context context, String message)
  4. dismissProgressBar(ProgressDialog progressBar)
  5. showConnectionErrorDialog(Context c)
  6. makeSimpleDialog(Activity activity, String text)
  7. makeSimpleDialog(Activity activity, String title, String text)
  8. showDownloadDialog(final Activity activity, CharSequence stringTitle, CharSequence stringMessage, CharSequence stringButtonYes, CharSequence stringButtonNo, final String uriString)