手機:華為榮耀6plus 系統(tǒng)為 Android 4.4.4
當需要設(shè)置允許調(diào)用Js的時候會出錯
settings.setJavaScriptEnabled(true);
Activity has leaked ServiceConnection com.android.org.chromium.com.googlecode.eyesfree.braille.selfbraille.SelfBrailleClient$Connection@41e46c20 that was originally bound here
如上發(fā)生了內(nèi)存泄漏,應該是某個組件持有context,生命周期要比Activity長,引發(fā)的泄漏
將Webview 的初始化 改成 super(context.getApplicationContext());
和super(context.getApplicationContext(), attrs);
就不會引發(fā)泄漏了