开发者

How can a MapView be embedded into an existing Activity?

I am working on an Android Tablet application, one of the Class involves displaying a bunch of text and data lists along with a Map. So far all my text and data components are in place and only the Map needs to be inserted, The usage of the MapView means I need to extend MapActivity instead of just extending Activity.

What is the solution to this? Should I rewrite my Class extending MapActivity or is there any way to write a separate class with MapActivity extended for the MapView and then embed that class within my original Class.开发者_开发技巧

If the latter solution is feasible how how would I go about doing it?


Afaik there is no way to include a MapView without extending a MapActivity.
I guess rewriting your class will be the simplest way.


I figured out a simple solution, all you need to do is have a nested subclass inside your main class for the MapView that extends MapActivity so that does the trick.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜