1

伙计们。

我在我的 android 应用程序中使用 WebView,但是当我关闭使用它的活动时,它总是会在 logcat 中给我一个异常:

 android.app.IntentReceiverLeaked: Activity XXXViewActivity has leaked IntentReceiver android.webkit.WebView$WebViewReceiver@4182eab0 that was originally registered here. Are you missing a call to unregisterReceiver()?

我查看了android.webkit.WebView的android src,但是没有发现WebViewReceiver,那是什么问题呢?

我的一些代码:

webView = new MmsWebView(this, mid);
webView.setHorizontalScrollBarEnabled(true);
webView.setHorizontalScrollbarOverlay(true); 
WebSettings settings = webView.getSettings();
settings.setSupportZoom(true);
settings.setBuiltInZoomControls(true);
settings.setDisplayZoomControls(true);
webView.loadDataWithBaseURL(null, mmsBody, "text/html", "utf-8", null);
...
...
public class MmsWebView extends WebView {
  private final Context context;
  private final int mid;
  public MmsWebView(Context context, int mid) {
    super(context);
    this.context = context;
    this.mid = mid; 
    init();
  }
  ...
}
4

0 回答 0