开发者

Displaying a MapView with a SubAcivity

开发者 https://www.devze.com 2023-01-11 02:33 出处:网络
I have a main activity. its main.xml generates a view that开发者_如何转开发 holds a slider, which on click, reveles some area for conent. In this area I want to display a map. so I need a second activ

I have a main activity. its main.xml generates a view that开发者_如何转开发 holds a slider, which on click, reveles some area for conent. In this area I want to display a map. so I need a second activity. I am able to call the sub activity but I want it to be displayed in the area of the slider of the main.xml, however the map has its own mapview.xml.

any ideas?


While it's true that you need a MapActivity in order to display a map, from what you describe I'm not convinced you actually nest Activities. There's nothing about MapActivity that requires that the XML not already have content area with a map in it.

If you really do want to use a MapActivity as a sub-activity, then you should use an ActivityGroup. The classic example of this is a TabActivity, which can have multiple Activities (one in each tab) - you could look at TabActivity's source code to determine how this is done.

0

精彩评论

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

关注公众号