Activity已泄漏最初绑定在此处的ServiceConnection android.speech.tts.TextToSpeech$Connection@d7f68ca

时间:2017-02-22 07:44:57

标签: android xwalkview

我使用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");
    }

0 个答案:

没有答案