Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.app.AlertDialog;

import android.content.Context;
import android.content.DialogInterface;

import android.widget.ImageView;

public class Main {
    public static void showAlertWithImage(String title, String msg, Context context, ImageView image) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context).setTitle(title).setMessage(msg)
                .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                    }
                }).setView(image);
        builder.create().show();
    }
}