3

I am using the following code to get location in a background service according to this answer

Best way to get user GPS location in background in Android

This issue is only found on xiaomi devices but it works as expected on other devices.

Criteria criteria = new Criteria();

String provider = mLocationManager.getBestProvider(criteria, false);

mLocationManager.requestLocationUpdates(

provider, LOCATION_INTERVAL, LOCATION_DISTANCE,

mLocationListeners[0]);

Adriaan
  • 17,741
  • 7
  • 42
  • 75
Ashwin H
  • 695
  • 7
  • 24

0 Answers0