Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.app.Activity;
import android.app.AlertDialog;

import android.text.TextUtils;

public class Main {
    /**
     * Will construct the AlertDialog.Builder object for convenience
     * 
     * @param context
     *            Application Context
     * @param message
     *            Message to be displayed.
     * @return AlertDialog.Builder object with the message set.
     */
    public static AlertDialog.Builder getDialogForStatus(Activity activity, String message, String title) {
        AlertDialog.Builder dialog = new AlertDialog.Builder(activity);
        dialog.setCancelable(false);
        if (!TextUtils.isEmpty(title)) {
            dialog.setTitle(title);
        }

        dialog.setMessage(message);
        return dialog;
    }
}