Question

I have been trying to find a way to get this done but keep running into issues. I want to be able to have a map in a frame (it does not necessarily have to be a FrameLayout, i just want it framed so it only takes up 1/2 or 2/3 the screen) ontop of my current layout and to have the current activity still displayed behind it.

In a perfect world, i would like to attach this view to a button and animation so clicking the button causes this view to slide in from offscreen left and settle in the center of my current activity, while still being fully clickable and and the map being useable (can zoom, click, etc.)

I have tried doing this with a fragment, but the issue is that the Activity i am working in is already extending another class that is absolutely necessary, so i can not extend Fragment or FragmentActivity, so i cant use fragments (unless i am missing a work around to achieve this.) The same goes for MapActivity and MapView, cant extend the MapActivity class so cant use MapView.

Any time i try to inflate a map view or anything i get runtime errors because my activity does not extend the pertinent class. Is there a work around for this?

Does anyone have a suggestion as to how i can get this map to display the way i am looking for? This is easily achieved in iOS but i cant seem to figure it out in Android.

Thank you in advance

EDIT

I am not looking for code, unless you have a specific example in which case obviously code is very helpful, but i am looking for an idea as to how to achieve this -- a push in the right direction if you will -- so i can write the code myself.

Was it helpful?

Solution

Solved this by adding a frame layout to my "Main" activity. That frame layout's class was set to my Map class. The Map class extended FragmentActivity and its contentView is set to my map_fragment.xml. The map_fragment.xml contains only a fragment and that fragments name is set to com.google.android.....SupportMapFragment.

After setting up my project in this way as well as setting up the correct screen layouts and dimensions for sizing purposes as well as defining a GoogleMap in my Map class, i was able to display a fully usable and interactive map over my "Main" activity.

I overrode some Activity transition animations to the Map class and got my project working 100% how i want it to.

I didnt ask for code, so i will not supply any code, but this process is pretty straight-forward if you follow the same process as i have described above.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top