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.app.Dialog;
import android.content.DialogInterface;

public class Main {
    public static Dialog createMessageDialog(Activity activity, String message) {
        final CharSequence[] phoneQuit = { "OK" };
        AlertDialog.Builder builder = new AlertDialog.Builder(activity).setIcon(android.R.attr.alertDialogStyle)
                .setTitle("Pay Attention Please !!!").setMessage(message)
                .setNeutralButton("OK", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                        dialog.dismiss();
                    }
                });

        return builder.create();
    }
}