3

I have an app having actionbar where one of the fragments contain a mapFragment. Also, i've to make an overlay of list on top of the map. MapFragment as of now as lesser functionality(i cant make setInfoWindowAdapter to work in it).So my question is should I be using Mapview within a fragment or MapFragment within in a fragment? which is the best practice? I've read through many articles but none them exactly mention which is the best option and why.

Amritha Dilip
  • 723
  • 1
  • 8
  • 16

1 Answers1

2

Both are correct if done correct.

Fragments inside fragments are supported as of support library v11.

Two things to remember:

  1. you cannot put MapFragment to xml
  2. you have to use getChildFragmentManager

Check this link for how to correctly add MapFragment inside your fragment: http://code.google.com/p/gmaps-api-issues/issues/detail?id=5064#c1

MaciejGórski
  • 22,187
  • 7
  • 70
  • 94