Here you can find the source of makeSimpleDialog(Activity activity, String text)
Parameter | Description |
---|---|
activity | the Activity in which the Dialog should be displayed. |
text | the message to display on the Dialog. |
public static Dialog makeSimpleDialog(Activity activity, String text)
//package com.java2s; //License from project: Open Source License import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; public class Main { /**//from ww w . ja v a 2 s. c o m * Create a simple {@link Dialog} with an 'OK' button and a message. * * @param activity the Activity in which the Dialog should be displayed. * @param text the message to display on the Dialog. * @return an instance of {@link android.app.AlertDialog} */ public static Dialog makeSimpleDialog(Activity activity, String text) { return (new AlertDialog.Builder(activity)).setMessage(text) .setNeutralButton(android.R.string.ok, null).create(); } /** * Create a simple {@link Dialog} with an 'OK' button, a title, and a message. * * @param activity the Activity in which the Dialog should be displayed. * @param title the title to display on the dialog. * @param text the message to display on the Dialog. * @return an instance of {@link android.app.AlertDialog} */ public static Dialog makeSimpleDialog(Activity activity, String title, String text) { return (new AlertDialog.Builder(activity)).setTitle(title) .setMessage(text) .setNeutralButton(android.R.string.ok, null).create(); } }