Amritha Dilip
Amritha Dilip

Reputation: 733

MapFragment in a fragment Vs MapView in a fragment with Google Maps api v2

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.

Upvotes: 3

Views: 7098

Answers (1)

MaciejGórski
MaciejGórski

Reputation: 22232

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

Upvotes: 2

Related Questions