Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MapView without extending MapActivity

Is there a way to display a MapView without extending MapActivity? I have other Activity class which I'm extending and I would prefer not to change that... I've seen that you can inflate using MapActivity, but didn't find any spec/examples on how to do it.

like image 977
Michal Dymel Avatar asked Jun 10 '10 11:06

Michal Dymel


1 Answers

Is there a way to display a MapView without extending MapActivity?

Not that I am aware of.

I could extend my class with MapActivity, but that would mean all my activities would extend it

Then you need to refactor your code, such that your activities do not all inherit from your own base class. Inheritance is not a very flexible OO technique, particularly in Java.

like image 150
CommonsWare Avatar answered Sep 23 '22 03:09

CommonsWare