I want to define google maps in xml



I played with the google maps library, and loaded google maps into view as a SupportMapsFragment


However, the fact that this is an embeded fragment, causes a problem for me in other aspects of my app, mostly the fact that my maps fragment is a viewpager page fragment, and so when i call notify dataset changed on the viewpager, it kills my app because the maps fragment cant be refreshed, because it is embded in the xml.


Is it possible to define the MapView object in the xml without the enclosing fragment?


I read this gist : http://ift.tt/1rCEv4s


however, my app fails on this line


GoogleMap map = (GoogleMap)mapView.getMap(); <- NPE


what to do ?


No comments:

Post a Comment