16-07-2010, 11:30
Estou a usar o seguinte código para tentar obter as coordenadas actuais:
No entato, o l fica sempre com o valor null. O que estou a fazer mal?
Código:
lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
providers = lm.getProviders(true);
lm.requestLocationUpdates(lm.getBestProvider(new Criteria(), true), 20000, 50, this, getMainLooper());
Location l = lm.getLastKnownLocation(providers.get(0));
No entato, o l fica sempre com o valor null. O que estou a fazer mal?