Using Android MapView without the MapActivity?

2019-07-27 10:57发布

问题:

I'm in the process of encapsulating Android features and services, and I was trying to find the code of the MapActivity of Android to see how it is managing the MapView it contains, in order to implement this out side of this darn MapActivity which collides with my Android wrapper architecture...

Is it even possible to use the MapView without the MapActivity? Does anyone know about legal limitations of using the MapView, as I see fit in my application? (for example to display four friend on a single screen...?

Thanks in advance, Adam.

回答1:

In my opinion, answer is not.I have not Tested it but i think no because MapActivityincluded some classes and method that is available to MapActivityonly. Its some how different from listviewin which listviewcan be drawn using ListActivityand Activity.



回答2:

No you can't use MapView without MapActivity the reason is MapActivity is special sub-class of Activity, provided by the Maps library, which provides important map capabilities.

Edit

You can display map as per your requirement and you can change it's size by width and height and display other control with it