0

Basically what i am trying to do is Tab1 -> Organisation Map Fragment Tab2 -> City Map

How should I go about doing this. I tried following some tutorials but it gives me the error "You are allowed to have single MapView in a MapViewActivity". Can some one please help me out

Ravi Garg
  • 11
  • 1
  • 1
    http://www.google.com/search?q=You+are+allowed+to+have+single+MapView+in+a+MapViewActivity – Michaël Sep 24 '12 at 17:04
  • hey thanks for the reply i am pretty new to android so am finding this quite difficult to handle right now can u pls direct me to some tutorial or example implementing such stuff – Ravi Garg Sep 24 '12 at 17:23

3 Answers3

2

It's not possible to do this. As the message says, only one map per Activity.

Joe Malin
  • 8,621
  • 1
  • 23
  • 18
0

As Joe and the error message says, you can only have one mapview in a single activity.

What you could do (if you still want to use tabs) is just not change the fragment when the tab changes, and instead reload the map with different data.

Sababado
  • 2,524
  • 5
  • 33
  • 51
0

Google released the Map API Version 2. This finally allows to use a MapFragment and a SupportMapFragment. This allows adding Maps to ViewPagers and to Activities that do not extend MapActivity. It should also allow you to have multiple maps in one Activity

Janusz
  • 187,060
  • 113
  • 301
  • 369