android maps stop responding after resuming fragment

前端 未结 3 1816
悲&欢浪女
悲&欢浪女 2020-12-21 10:51

Listed below is my basic code for controlling the maps. I do some really advanced stuff later. Everything seems to work perfect, until onResume().

Here

相关标签:
3条回答
  • 2020-12-21 11:09

    To implement Scott Stanchfield's solution: call cleanFrame() when add/replace another fragment.

    public void cleanFrame(){
    FrameLayout FL = (FrameLayout) thisview.findViewById(R.id.myfragmentcontainer);
       FL.removeAllViewsInLayout();
    }
    
    0 讨论(0)
  • 2020-12-21 11:19

    Do you see anything in your logcat? I've had some issues like this before, and I believe it was related to the old map fragment's View not being removed from its parent ViewGroup before creating a new instance of it. This resulted in errors regarding a duplicate fragment.

    Try removing all views from your flMapContainer before you create the new instance of the SupportMapFragment.

    0 讨论(0)
  • 2020-12-21 11:24

    I have disabled hardware acceleration inside manifest.xml and after it everything started to work successfully:

    <application android:hardwareAccelerated="false">
     ...
    </application>
    
    0 讨论(0)
提交回复
热议问题