I am trying to port my iOS application to Android. Yup, you guessed it
- the iOS application uses multiple mapviews, and it works nicely.

In the Android app I don't need the mapviews all at the same time. So
I try to destroy the mapview already in the onPause method of my first
activity (by removing the mapview from the superview and setting the
mapview to null).  Nevertheless, on return from the other activity, I
get the dreaded "You already have a mapview in this activity" message
in my onResume.

How can I jettison the mapview from my activity?

On Oct 26, 1:38 am, gjs <[email protected]> wrote:
> Hi,
>
> I found that one map activity will interfere (greatly) with another
> map activity if the second is started from the first. But if you
> display some other non map activity between these two map activities
> then both map activities seem work ok.
>
> To get around these issues of needing to have two map activities, I
> found that I had to combine the functionality of both into one and
> switch overlays etc according to context. This was very messy but it
> does work...
>
> Regards
>
> On Oct 26, 7:26 am, TreKing <[email protected]> wrote:
>
> > On Sun, Oct 24, 2010 at 6:17 PM, Jon Perlow <[email protected]> wrote:
> > > The iphone version of the app shows maps in multiple places, but this is
> > > not possible with the android version because of this limitation.
>
> > Well, it's possible, just much more cumbersome. What you have to do is
> > abstract your other views / activities that would show the map and make them
> > views that you show and manage within the MapActivity. Not fun, put
> > theoretically possible.
>
> > Has anybody else had to make compromises to their application because of
>
> > > these limitations?
>
> > Yup - not too horrible yet, but as the number of different things I want to
> > do with the map grows, it's getting more and more complicated.
>
> > > Is the Google engineer who owns this API aware of the limitations?
>
> > I'm sure - they even documented it =P
>
> > > Are there any proposals to fix it?
>
> > Don't hold your breath. It doesn't look like the Maps API gets updated. It
> > is what it is.
>
> > >  Is the best workaround simply to use a WebView that uses the javascript
> > > API?
>
> > That, or as I mentioned, abstract your other functionality to work within
> > the one MapActivity. I think the Strategy Pattern might be a good fit for
> > this.
>
> > --------------------------------------------------------------------------- 
> > ----------------------
> > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> > transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to