Android – Google Maps API v2 – SupportMapFragment Errors

You need to extend FragmentActivity if you are using SupportMapFragment.
If you are using the MapFragment you can extend Activity.

In your layout, use

<fragment xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/map"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              class="com.google.android.gms.maps.SupportMapFragment"/>

instead of

...    
android:name="com.google.android.gms.maps.SupportMapFragment"
...

You must do this:

public class MainActivity extends android.support.v4.app.FragmentActivity{

}

Leave a Comment