google maps are returning null pointer exception

后端 未结 3 1907
孤城傲影
孤城傲影 2021-01-29 02:09

when I am trying to show the maps on my fragment it is returning null pointer exception. I have added everything to the manifest each and every permission. I am attaching the f

3条回答
  •  情书的邮戳
    2021-01-29 02:39

    java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.maps.GoogleMap com.google.android.gms.maps.SupportMapFragment.getMap()' on a null object reference
    
    1. You can use getChildFragmentManager() instead of getActivity().getSupportFragmentManager()
    2. Remove initilizeMap(); from your onResume method .

    Reference

    SupportMapFragment.getMap() on a null object reference

提交回复
热议问题