This is an automated email from the ASF dual-hosted git repository.
manuelbeck pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git
The following commit(s) were added to refs/heads/master by this push:
new 6b76757c CallbackContext: Add success method for boolean (#1864)
6b76757c is described below
commit 6b76757c8056681c29f14b9abfcbe5dbdcd1908b
Author: Manuel Beck <[email protected]>
AuthorDate: Wed Dec 17 10:31:26 2025 +0100
CallbackContext: Add success method for boolean (#1864)
- Add helper method for success callbacks that returns `Status.OK` with a
boolean
---
framework/src/org/apache/cordova/CallbackContext.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/framework/src/org/apache/cordova/CallbackContext.java
b/framework/src/org/apache/cordova/CallbackContext.java
index 43363869..fe80622a 100644
--- a/framework/src/org/apache/cordova/CallbackContext.java
+++ b/framework/src/org/apache/cordova/CallbackContext.java
@@ -61,6 +61,15 @@ public class CallbackContext {
webView.sendPluginResult(pluginResult, callbackId);
}
+ /**
+ * Helper for success callbacks that just returns the Status.OK by default
+ *
+ * @param message The message to add to the success result.
+ */
+ public void success(boolean message) {
+ sendPluginResult(new PluginResult(PluginResult.Status.OK, message));
+ }
+
/**
* Helper for success callbacks that just returns the Status.OK by default
*
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]