StuStirling
StuStirling

Reputation: 16211

Android Google Maps API V2.0 - Including MapView in XML

I am trying to insert a MapView into a Fragment however I can't find the correct class to cast the MapView object to.

I am inserting the MapView into my fragment like so.

<com.google.android.gms.MapView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/map_view_track"/>

However, I inevitably get a ClassCastException.

Is it possible to insert a MapView this way? I'm pretty sure it is.

Upvotes: 1

Views: 6099

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007349

com.google.android.gms.Maps does not exist as a class, AFAIK. Try com.google.android.gms.maps.MapView.

Upvotes: 6

Related Questions