SupportMapFragment.getmap() returns null

前端 未结 6 728
刺人心
刺人心 2020-11-30 11:49

I\'m trying to load SupportMapFragment dynamically in a fragment, here is my onCreateView() method:

@Override
    public View onCreateView(LayoutInflater inf         


        
6条回答
  •  北海茫月
    2020-11-30 12:30

    There's a bunch of duplicate questions that go around the same topic... I can't seem to figure out how to flag it as a duplicate and then put one answer on it...

    Here's the link to the other one: Android SupportMapFragment.getMap() returns null

    And the potential answer posted there as well:

    Check your layout xml file. I noticed that I wasn't referencing: android:name="com.google.android.gms.maps.SupportMapFragment" but rather: android:name="com.google.android.gms.maps.MapFragment"

    The name should be: android:name="com.google.android.gms.maps.SupportMapFragment"

提交回复
热议问题