# Google Maps API oddity..



## Foxtrot_Xray (Dec 28, 2011)

Hey all, first time posting, long time lurker.

Thought I'd ask about an oddity I'm getting - in the least, it couldn't hurt to get opinions on it.

Using the Google API's v8 (2.2) in my app, and have two Activities -
One, the entry and main Activity uses a MapView. it has other controls overlaid in it, and everything works as can be expected.
The second activity has a small MapView. The Activity sets the MapView's zoom and location, and doesn't allow the user to pan/zoom in or out. This also works as can be expected.

The issue comes in the following flow:
(1) User runs app, uses main activity to select something.
(2) Upon selecting item on map, they get taken to the second activity.
(3) Second activity auto-centers and auto-zooms map on point user clicked.
(4) User hits the Back softkey, and gets taken to the main Activity.
(5) Now, here's the off thing - the MapView they WERE looking at is now centered and zoomed in to the same 'specs' as the one in the second activity.

Apparently, the second MapView is saving settings that the first one's using, despite being two different controls, in two different activities.

I'm still fooling around, but if anyone has anything to check, I'd be interested to hear.

Cheers..


----------



## zalez (Dec 1, 2011)

I believe you are seeing this because you can/should only run one mapview per process.

Try making a separate process for you second mapview sorta like this:

<activity android:name=".activity.MapView1" androidrocess=":MapView1">

<activity android:name=".activity.MapView2" androidrocess=":MapView2">


----------



## Foxtrot_Xray (Dec 28, 2011)

zalez said:


> I believe you are seeing this because you can/should only run one mapview per process. Try making a separate process for you second mapview sorta like this:


Thanks, that did it!

Now let me ask - was this documented somewhere? (If so, could you point me there?) I hate asking things when they're documented, and I missed this somehow!!

Cheers -
Mike.


----------



## zalez (Dec 1, 2011)

I never could find it in the dev documents but I had ran in to the same problem when I was doing something similar. Glad I remembered it


----------



## Foxtrot_Xray (Dec 28, 2011)

zalez said:


> I never could find it in the dev documents but I had ran in to the same problem when I was doing something similar. Glad I remembered it


Thanks again. I wanted to make sure I didn't miss a documentation page. (I have about 7 bookmarked now.) This app I'm working on is not only my first foray into Android, but into Java as well, so it's been one heck of a learning experience.


----------

