Okay, I think its just a case of not having enough memory, so for now I'll forget switching between two activities where one activity launches a new MapActivity instance.
I have created another version of my app which uses one MapView, however that too has some problems ;) Fancy having a look at that issue? http://groups.google.com/group/android-developers/browse_thread/thread/81631e00bd25ee83/bfb7f675eb8faadc?lnk=gst&q=mscwd01#bfb7f675eb8faadc If I can get that solved, I should be fine! Thanks again! On Dec 8, 11:47 pm, Mark Murphy <[EMAIL PROTECTED]> wrote: > mscwd01 wrote: > > > Hope I havent confused you ;) > > No, but you have made my head hurt. > > > Oh btw I purchased your "The Busy Coder's Guide to Android > > Development" book - its very helpful ;) > > My head feels better now... ;-) > > > However what i'm asking is, is there a way to kill off Activity2 > > completely when pressing the Back button to return to Activity1 and > > return full control to the first map? > > Well, you already tried the stock answer of using finish(). With your > kill-my-process hack, you're heading down in a direction which, on my > map of Android, is labeled "Here There Be Dragons"... > > > I believe I am making more and > > > more map objects when I launch Activity2 again and again and not > > releasing resources when I finish with it? > > Or they're just not getting garbage collected fast enough or something. > > I have a suggestion. I have no idea how crazy it will be for you to > utilize if it works. > > In Activity1, temporarily replace launching Activity2 with a > startActivity() that launches the built-in Maps application. You should > be able to do this through: > > startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("geo:40,-75"))); > > which will give you a map of the NJ side of the Philadelphia suburbs. > > Now, try bouncing back and forth between your Activity1 and the Maps > application, like you were bouncing between Activity1 and Activity2. > > If things fail as before, I think you may just be screwed, at least in > terms of rapidly flipping between two MapView instances. They may make > too much garbage. > > If, however, this holds up, it may be you can only effectively have one > MapView per *application* if you want to rapidly switch between them. In > that case, your mission (should you choose to accept it) is to split > your project into two separate applications. This would suck mightily, > particularly if you were looking to deploy via a market, but it's > possible it is the best way for you to get two stable MapViews under > your control. > > If it were me, I'd try very very hard to get by with one map, somehow. > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > _The Busy Coder's Guide to Android Development_ Version 1.9 Available! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

