android:调整日志,添加 onDestroy();
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user