ActionBarSherlock + Google Maps API v2 Duplicate Id

前端 未结 2 1769
陌清茗
陌清茗 2021-01-18 03:15

I\'m trying to integrate the ActionBarSherlock with Google Maps API v2 fragments.

I have a layout with 2 fragments: one for a list layout and another with a SupportM

相关标签:
2条回答
  • 2021-01-18 03:51

    This is not a problem with ActionBarSherlock, but a broader one when you have SupportMapFragment inside your custom fragment.

    You need to use getChildFragmentManager() to add SupportMapFragment and not through xml.

    Take a look at my answer here: MapFragment in Fragment, alternatives?

    0 讨论(0)
  • 2021-01-18 03:54

    Take the id off the Item list fragment in your XML file.

    Then put the fragment inside a container layout (LinearLayout). If you need to refer to the fragment go through that layout.

    Make sure that you use the onCreateView function instead of the onCreate inside the fragment class.

    0 讨论(0)
提交回复
热议问题