Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Activity has leaked ServiceConnection com.android.org.chromium.com.googlecode.eyesfree.braille.selfbraille.SelfBrailleClient$Connection

My Android app has a Webview inside a Fragment, the Webview is displaying a simple HTML document. When I quit the app, the logcat show the following error:

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)

I try to search the error on the net but no luck. Does anybody know what is this exception for?

I am using the following device to test:

Device: LG G2 (F320S21d)
Android Version: 4.4.2
Runtime Mode: ART
like image 563
Hanon Avatar asked Mar 06 '14 03:03

Hanon


1 Answers

You need some code on life cycle onDestory()

if(webview ! = null) { webview.destory(); webview == null;}
like image 64
guofeng Avatar answered Oct 21 '22 04:10

guofeng