Reputation: 1231
I am trying to use the google maps API v2 for android and I followed these instructions exactly
https://developers.google.com/maps/documentation/android/start
and everything works fine until I put this code into the layout file
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />
once that code is put in the app crashes when opened, this picture also appears on the graphical layout
Thanks in advance!
Upvotes: 0
Views: 283
Reputation: 6899
Use support Mapfragment
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.SupportMapFragment"
/>
GoogleMap gm;
gm = ((SupportMapFragment(getSupportFragmentManager().findFragmentById(R.id.map))).getMap();
gm.setMapType(GoogleMap.MAP_TYPE_NORMAL);
Upvotes: 1