Sto utilizzando l'API V1 di Google Maps. ho questo errore:IllegalArgumentException: provider non esistente: null su Maps V1
java.lang.IllegalArgumentException: provider doesn't exisit: null
Questo è il mio codice:
locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
String provider = locationManager.getBestProvider(criteria, true);
if (provider != null)
{
startTime = System.currentTimeMillis();
geoLocTimeOutTask = new GeoLocTimeOutTask();
geoLocTimeOutTask.execute();
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);
}
else
{
geoLocCallbackObj.geoLocationCallback(tagCallback);
}
ho capito l'errore, bu la mia domanda è, whay il dispositivo mi ha messo questo errore? E come posso evitare questo per favore?
Il responsabile della posizione non ha nulla a che fare con google maps e probabilmente ha a che fare con l'emulatore – tyczj
su quale linea si sta verificando l'eccezione? – tyczj
Qui: locationManager.requestLocationUpdates (LocationManager.NETWORK_PROVIDER, 0, 0, locationListener); –