views:

36

answers:

1

Hi,

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?


A: 

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.

Daniel Lew
well, I just want to have a map at the upper part of my screen and other content elements at the top of my screen and my question whether I have to use sub activity or something else
ArtWorkAD
here is an example for sliding drawer that shows what I acutally mean -> http://androidblogger.blogspot.com/2009/01/sliding-drawer-again.htmlinside the content area which the slider open I want to place a map
ArtWorkAD
It's fine to make an activity whose main purpose is to display many other things that also contains a map, and have it all be one MapActivity. The only reason you'd need to have a subactivity is if you absolutely can't use MapActivity as the Activity class.
Daniel Lew
thanks it works now, I have it all be one MapActivity
ArtWorkAD