android.view.WindowLeaked: Activity has leaked window android.widget.ZoomButtonsController$Container that was originally added here

前端 未结 3 1083
醉梦人生
醉梦人生 2021-02-15 12:01

Working with maps i have an activity which is launched when no connection is available and uses offline maps (MapQuest). The activity runs fine, map is shown, and all overlays,

3条回答
  •  暖寄归人
    2021-02-15 12:27

    Add this to your activity:

    @Override
    public void finish() {
        ViewGroup view = (ViewGroup) getWindow().getDecorView();
        view.removeAllViews();
        super.finish();
    }
    

提交回复
热议问题