I have been using Google Maps API v2 for long time on Android 4.x versions without any issues. Now I have installed the latest lollipop build on my Nexus device (5 and 7) when trying to implement the app.
I would say that everything is fine on KitKat and the problem I am telling is popping only on the lollipop.
In my XML source code, I am using MapFragment (Google Play Services Library version 6.1.11).
& lt; Fragment android: id = "@ + id / map" Android: layout_width = "match_parent" Android: layout_height = "match_parent" android: name = "com.google.android.gms .maps.MapFragment" />
In Java code, I am overriding the OnPause () method to access the map:
GoogleMap map = (MapFragment) getFragmentManager () FindFragmentById (R) .id.map)) getMap () .;
On this line throws NullPointerException. The debugger is able to find a piece in the app, though it is not able to return GoogleMap. I also tried to use MapView, it also throws null. The most strange thing for me is that the map loads without any problem without the app, but in the code I can not get it to work with it.
Comments
Post a Comment