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;

public class Main {
    public static void displayErrorStay(String message, Context context) {
        // no deals found so display a popup and return to search options
        AlertDialog.Builder builder = new AlertDialog.Builder(context);

        // set title
        builder.setTitle("No Results");

        // set dialog message
        builder.setMessage(message).setCancelable(false).setPositiveButton("Ok",
                new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        dialog.cancel();
                    }
                });
        // create alert dialog
        AlertDialog alertDialog = builder.create();

        // show it
        alertDialog.show();
    }
}