Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/**
 * 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();

    }
}