Issue
I cannot find mapview in Android Studio palette. I am using the new Android Studio and it seems silly but I cannot find this. I looked through the development site but it seems mapview does still exist.
Is there something I am missing?
I aslo tried to just add it in the XML and it says the the mapview class is not found.
Solution
In Android Studio (as well as in IntelliJ) there is no MapView
in palette. If you need to use Maps in your layout, declare it with:
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />
Google Maps Android API v2 documentation
There you have a nice reference how to use maps v2.
We used MapView
in Android Maps v1, but now it is deprecated (reference). So this is the reason why there is no MapView
in Android Studio palette.
Answered By - mmBs
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.