1

I've been reading rumors of a FragmentMapActivity class, but I can't find code for it that seems recent enough to handle the current API.

KairisCharm
  • 1,363
  • 1
  • 13
  • 32
  • 1
    try this link http://sunil-android.blogspot.in/2013/07/google-map-android-api-v2-with-location.html – Sunil Kumar Aug 05 '13 at 18:02
  • `MapActivity` is for the now-deprecated Maps V1. Maps V2 has built-in fragments support. – CommonsWare Aug 05 '13 at 18:09
  • Then.... MapViews are deprecated as well? What do I use instead then? – KairisCharm Aug 05 '13 at 18:15
  • There is still a `MapView`, you just don't have to be in a `MapActivity` to work – crocboy Aug 05 '13 at 18:17
  • Then why is it, when running with a Google API level of 18, that I get this error in my log, and crash: 08-05 13:13:42.201: E/AndroidRuntime(14082): Caused by: java.lang.IllegalArgumentException: MapViews can only be created inside instances of MapActivity. – KairisCharm Aug 05 '13 at 18:22
  • 1
    "Then.... MapViews are deprecated as well?" -- Maps V2 has its own `MapView`, designed to be used from its `MapFragment` or `SupportMapFragment`, though you can use it directly as well. "Then why is it, when running with a Google API level of 18, that I get this error in my log" -- because you are using Maps V1. Maps V1 has been deprecated for ~8 months. Please read https://developers.google.com/maps/documentation/android/v1/ and https://developers.google.com/maps/documentation/android/ – CommonsWare Aug 05 '13 at 18:41
  • I'm trying to verify what you're saying, but my SDK Manager is acting up. It's not showing up as an option in Eclipse, and when I open it from Windows, it starts up a command line and then immediately stops. I'll have to work this out before I can verify. – KairisCharm Aug 05 '13 at 19:18
  • I had the same problem. Are you on Windows 7? – crocboy Aug 06 '13 at 13:00
  • Yea. I figured it out. I had updated my ADT, and what you need to do is go into the DDMS perspective, then go to Window->"Customize Perspective", then into "Command Groups Availability", check "Android SDK and AVD Manager" then back into "Tool Bar Visibility" and check "Android SDK and AVD Manager". Then you can run from eclipse like you used to. – KairisCharm Aug 06 '13 at 15:58
  • Also, the problem was not that I had v1 of google maps. I had only downloaded and started trying to use the Google Maps library last week. The problem was that I wasn't using SherlockMapFragment. For some reason, the error still states that it needs to be in a MapActivity to work. – KairisCharm Aug 06 '13 at 16:02
  • Ok... I was wrong. I'm using SupportMapFragment now, and I still get the exact same error. – KairisCharm Aug 06 '13 at 19:59
  • Now I got it. You don't use a MapView anymore. You nest a SupportMapFragment inside another fragment. – KairisCharm Aug 06 '13 at 20:27

0 Answers0