MapView in a Fragment (Honeycomb)
I've managed to resolve this by using TabHost in fragment.
Here is the idea (briefly):
MainFragmentActivity
extendsFragmentActivity
(from support library) and hasMapFragment
.MyMapActivity
extendsMapActivity
and containMapView
.LocalActivityManagerFragment
hostsLocalActivityManager
MapFragment
extendsLocalActivityManagerFragment
.And
LocalActivityManager
containsMyMapActivity
activity in it.
Example implementation: https://github.com/inazaruk/map-fragment.
As discussed at Google Groups, Peter Doyle built a custom compatibility library supporting Google Maps too. android-support-v4-googlemaps
However, there's a downside too:
Currently, one downside is that ALL classes extending FragmentActivity are MapActivitys. Its possible to make a separate class (i.e. FragmentMapActivity), but it requires some refactoring of the FragmentActivity code.