Reputation: 711
I have an android app that is using a sliding drawer with a framelayout to hold a details view. On selection of an item in the drawer, the main activity replaces fragments in the framelayout using a call like...
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
To show google maps v2 in the fragment, I've had to define a MapView inside a Fragment in order to get the replace call to work correctly.
Now that's one way to implement it, I could also have defined a MapFragment inside a Fragment using the new nested fragments capability. So given that in the future I want to add icons and control the map from code, which approach is better and why?
Upvotes: 1
Views: 694
Reputation: 18775
MapFragment
MapView
In your case as your using the fragment it is better to use the map view. That way you will avoid cascading fragments when you don't have to.
Upvotes: 2