7 package com.google.appinventor.components.runtime.util;
9 import android.app.Activity;
10 import android.app.AlertDialog;
11 import android.content.Context;
12 import android.content.DialogInterface;
13 import android.util.Log;
22 public static void alert(
final Object context,
23 final String message,
final String title,
final String buttonText) {
24 Log.i(
"RuntimeErrorAlert",
"in alert");
25 AlertDialog alertDialog =
new AlertDialog.Builder((Context) context).create();
26 alertDialog.setTitle(title);
27 alertDialog.setMessage(message);
28 alertDialog.setButton(buttonText,
new DialogInterface.OnClickListener() {
29 public void onClick(DialogInterface dialog,
int which) {
30 ((Activity) context).finish();
32 if (message ==
null) {