我使用XWalkView加载HTML页面,当我退出Activity时,我在logcat中收到此消息。enter image description here
看来我是bindService,但退出Activity时不是unbindService。我不知道怎么摆脱这个问题,谁能帮帮我?
@Override
protected void onXWalkReady() {
initXWalkView();
mXWalkView.load(URL,null);
}
@SuppressLint("SetJavaScriptEnabled")
private void initXWalkView() {
try {
Method method = XWalkView.class.getDeclaredMethod("getBridge");
method.setAccessible(true);
XWalkViewBridge bridge = (XWalkViewBridge) method.invoke(mXWalkView);
XWalkSettingsInternal settings = bridge.getSettings();
settings.setJavaScriptEnabled(true);
} catch (Exception e) {
e.printStackTrace();
}
WebAppInterface webAppInterface = new WebAppInterface(PatrolActivity.this);
mXWalkView.addJavascriptInterface(webAppInterface, "GreenSchool");
}