I'm moving my app to the new Google's API for Android. I've decided to use the MapView and not the Fragment since the map is a part of a Fragment. I've succeeded to show a map with the MapFragment, but when trying to do the same with the MapView it just shows empty tiles. Does anyone has a clew what I'm missing? These are the permissions from the Manifest file:
<permission android:name="com.beezer.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.beezer.permission.MAPS_RECEIVE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
I don't get any error in the log.
Have you forwarded all the Activity life cycle methods as written here https://developers.google.com/maps/documentation/android/map#mapview
"Users of this class must forward all the Activity life cycle methods - such as onCreate(), onDestroy(), onResume(), and onPause() - to the corresponding methods in the MapView class."
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mapView.onCreate(savedInstanceState);
try {
MapsInitializer.initialize(mContext);
} catch (GooglePlayServicesNotAvailableException e) {
e.printStackTrace();
}
}
@Override
public void onPause() {
super.onPause();
mapView.onPause();
}
@Override
public void onResume() {
super.onResume();
mapView.onResume();
}
@Override
public void onDestroy() {
super.onDestroy();
mapView.onDestroy();
}
There are only two issues I can this of :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With