views:

67

answers:

1

Does anyone happen to know if Google's MapActivity will eat up extra resources if an Activity does not use Google's MapView? The reason I ask it because I'd like to have a base activity class (which would extend MapActivity) for my activities in my application, but I don't want my resources to be eaten up when the user is in an activity that doesn't utilize Google's MapView.

Thanks in advance for any help!

Regards, celestialorb.

+1  A: 

I'd be careful of doing it this way - I'm not sure whether it's smart enough not to do network access etc if there is no MapView present, but the docs state

Only one MapActivity is supported per process. Multiple MapActivities running simultaneously are likely to interfere in unexpected and undesired ways

http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapActivity.html

What is the benefit you gain of your non-map based classes extending MapActivity? It would certainly be very confusing to a reader of your code.

I82Much
The problem is because Java doesn't support multiple inheritance. I want to have all of my activities (including ones that will use a MapView) extend and inherit code in various methods, but I can't do that with the activities with a MapView because they can't extend MapActivity and my base activity class.
celestialorb
Too bad Java doesn't have traits like Scala... would be perfectly suited in this situation.
I82Much