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

前端 未结 3 1084
醉梦人生
醉梦人生 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:41

    The problem with this leak window does not appear in the following version of Android 3.0 , so,you can try to do :

        // enabled zoom support
        getSettings().setSupportZoom(true);
        getSettings().setBuiltInZoomControls(true);
    
        // but,We should hide this button, otherwise in the version
        // of Android 3 and above, there is a window leak.
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            // call requies API Level 11 ( Android 3.0 + )
            getSettings().setDisplayZoomControls(false);
        }
    

提交回复
热议问题