gpt4 book ai didi

android - Activity 已泄露 ServiceConnection com.android.org.chromium.com.googlecode.eyesfree.braille.selfbraille.SelfBrailleClient$Connection

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:38:44 35 4
gpt4 key购买 nike

我的 Android 应用程序在 Fragment 中有一个 Webview,Webview 正在显示一个简单的 HTML 文档。当我退出应用程序时,logcat 显示以下错误:

03-06 10:58:29.468: E/ActivityThread(420): Activity com.abc.test.MainActivity has leaked ServiceConnection com.android.org.chromium.com.googlecode.eyesfree.braille.selfbraille.SelfBrailleClient$Connection@66247648 that was originally bound here
03-06 10:58:29.468: E/ActivityThread(420): android.app.ServiceConnectionLeaked: Activity com.abc.test.MainActivity has leaked ServiceConnection com.android.org.chromium.com.googlecode.eyesfree.braille.selfbraille.SelfBrailleClient$Connection@66247648 that was originally bound here
03-06 10:58:29.468: E/ActivityThread(420): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:989)
03-06 10:58:29.468: E/ActivityThread(420): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:883)
03-06 10:58:29.468: E/ActivityThread(420): at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1649)
03-06 10:58:29.468: E/ActivityThread(420): at android.app.ContextImpl.bindService(ContextImpl.java:1632)
03-06 10:58:29.468: E/ActivityThread(420): at android.content.ContextWrapper.bindService(ContextWrapper.java:517)
03-06 10:58:29.468: E/ActivityThread(420): at com.android.org.chromium.com.googlecode.eyesfree.braille.selfbraille.SelfBrailleClient.doBindService(SelfBrailleClient.java:125)
03-06 10:58:29.468: E/ActivityThread(420): at com.android.org.chromium.com.googlecode.eyesfree.braille.selfbraille.SelfBrailleClient.access$1000(SelfBrailleClient.java:43)
03-06 10:58:29.468: E/ActivityThread(420): at com.android.org.chromium.com.googlecode.eyesfree.braille.selfbraille.SelfBrailleClient$SelfBrailleHandler.handleRebindService(SelfBrailleClient.java:260)
03-06 10:58:29.468: E/ActivityThread(420): at com.android.org.chromium.com.googlecode.eyesfree.braille.selfbraille.SelfBrailleClient$SelfBrailleHandler.handleMessage(SelfBrailleClient.java:245)
03-06 10:58:29.468: E/ActivityThread(420): at android.os.Handler.dispatchMessage(Handler.java:102)
03-06 10:58:29.468: E/ActivityThread(420): at android.os.Looper.loop(Looper.java:136)
03-06 10:58:29.468: E/ActivityThread(420): at android.app.ActivityThread.main(ActivityThread.java:5105)
03-06 10:58:29.468: E/ActivityThread(420): at java.lang.reflect.Method.invoke(Native Method)
03-06 10:58:29.468: E/ActivityThread(420): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
03-06 10:58:29.468: E/ActivityThread(420): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)

我尝试在网上搜索错误,但没有成功。有人知道这个异常是做什么用的吗?

我正在使用以下设备进行测试:

Device: LG G2 (F320S21d)
Android Version: 4.4.2
Runtime Mode: ART

最佳答案

你需要一些关于生命周期 onDestory() 的代码

if(webview ! = null) { webview.destory(); webview == null;}

关于android - Activity 已泄露 ServiceConnection com.android.org.chromium.com.googlecode.eyesfree.braille.selfbraille.SelfBrailleClient$Connection,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22214052/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com