diff android/dw.cpp @ 2505:a149dabf6a1f

Android: HTML touchups, implement DW_SIGNAL_HTML_CHANGED: STARTED and COMPLETE. Make sure Javascript is enabled and that links open in the same WebView.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 06 May 2021 22:02:49 +0000
parents 1c2a79313b04
children f54051c3f2a5
line wrap: on
line diff
--- a/android/dw.cpp	Thu May 06 11:22:41 2021 +0000
+++ b/android/dw.cpp	Thu May 06 22:02:49 2021 +0000
@@ -377,7 +377,7 @@
     _dw_event_handler(obj1, params, message);
 }
 
-/* Handler for HTML events */
+/* Handlers for HTML events */
 JNIEXPORT void JNICALL
 Java_org_dbsoft_dwindows_DWindows_eventHandlerHTMLResult(JNIEnv* env, jobject obj, jobject obj1,
                                                jint message, jstring htmlResult, jlong data) {
@@ -388,6 +388,15 @@
 }
 
 JNIEXPORT void JNICALL
+Java_org_dbsoft_dwindows_DWWebViewClient_eventHandlerHTMLChanged(JNIEnv* env, jobject obj, jobject obj1,
+                                                         jint message, jstring URI, jint status) {
+    const char *uri = env->GetStringUTFChars(URI, NULL);
+    void *params[8] = { NULL, DW_POINTER(uri), NULL, DW_INT_TO_POINTER(status), 0, 0, 0, 0 };
+
+    _dw_event_handler(obj1, params, message);
+}
+
+JNIEXPORT void JNICALL
 Java_org_dbsoft_dwindows_DWindows_eventHandlerInt(JNIEnv* env, jobject obj, jobject obj1, jint message,
                                                jint inta, jint intb, jint intc, jint intd) {
     void *params[8] = { NULL, NULL, NULL,