From 48d6bf4c159fd0d7da327341b30ec26ad548c0da Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 28 Apr 2024 11:04:29 -0400 Subject: [PATCH] Hook up onJsAlert on android. --- .../tildefriends/TildeFriendsActivity.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/android/com/unprompted/tildefriends/TildeFriendsActivity.java b/src/android/com/unprompted/tildefriends/TildeFriendsActivity.java index 97f04259..bd65fd42 100644 --- a/src/android/com/unprompted/tildefriends/TildeFriendsActivity.java +++ b/src/android/com/unprompted/tildefriends/TildeFriendsActivity.java @@ -207,6 +207,23 @@ public class TildeFriendsActivity extends Activity { return true; } + @Override + public boolean onJsAlert(WebView view, String url, String message, JsResult result) { + new AlertDialog.Builder(view.getContext()) + .setTitle("Tilde Friends") + .setMessage(message) + .setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() + { + public void onClick(DialogInterface dialog, int which) + { + result.confirm(); + } + }) + .create() + .show(); + return true; + } + /* ** https://stackoverflow.com/questions/5907369/file-upload-in-webview ** https://stackoverflow.com/questions/8586691/how-to-open-file-save-dialog-in-android