user1252459
user1252459

Reputation: 563

Google maps v2 getting fragment instance

I am trying to make a map which is in tab. I added support library so that Google maps would be supported from 2.2 android version. The main problem is that my tabs are fragments and nested fragments are not supported I created two xml files:
1) has an Relative layout and is inflated when onCreateView() method is called in tab
2) second xml file hold fragment which is instance of SupportMapFragment

The second xml file is inflated and added to first xml file Relative layout. Map is shown but I cant get the instance of fragment. Is there a way to get instance off fragment in a view?

Upvotes: 0

Views: 536

Answers (1)

Yaroslav Mytkalyk
Yaroslav Mytkalyk

Reputation: 17105

The nested fragments are supported since API Level 4.2 and support library 11. They should be added dynamically and can be accessed by getChildFragmentManager().

Upvotes: 1

Related Questions