android:调整日志,添加 onDestroy();

This commit is contained in:
2026-01-27 14:28:17 +08:00
parent 2fa131c852
commit 8cd1703309

View File

@@ -124,7 +124,7 @@ public class ShutoApi extends CordovaPlugin {
pluginResult.setKeepCallback(true);
this.eventCallbackContext.sendPluginResult(pluginResult);
} catch (JSONException e) {
e.printStackTrace();
LOG.w(TAG, e);
}
}
@@ -156,7 +156,7 @@ public class ShutoApi extends CordovaPlugin {
pluginResult.setKeepCallback(true);
this.eventCallbackContext.sendPluginResult(pluginResult);
} catch (JSONException e) {
e.printStackTrace();
LOG.w(TAG, e);
if (callback != null) {
callback.onError("Failed to create event data: " + e.getMessage());
}
@@ -195,6 +195,14 @@ public class ShutoApi extends CordovaPlugin {
callbackContext.success();
}
@Override
public void onDestroy() {
super.onDestroy();
if (eventCallbacks != null) {
eventCallbacks.clear();
}
}
// 提供给原生代码查询就绪状态的接口
public boolean isIonicReady() {
return isIonicReady;