Skip to content Skip to sidebar Skip to footer

Cannot Resolve Method "getmapasync"

Excuse me for any grammatical errors. I followed a tutorial to view the google map in a fragment, but something has gone wrong. this is my file .java that is hooked with the fragme

Solution 1:

You have to use SupportMapFragment rather than MapFragment in XML

<fragment
    android:id="@+id/map"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    class="com.google.android.gms.maps.SupportMapFragment"></fragment>

in Fragment

SupportMapFragmentfragment= (SupportMapFragment)getChildFragmentManager().findFragmentById(R.id.map);
fragment.getMapAsync(this);

Post a Comment for "Cannot Resolve Method "getmapasync""