Open AssisBernardo opened 6 years ago
Hi :) Sorry for delay.
My colleague had the same issue on a single device with Android 8. And it has disappeared after one day.
It seems like Android LocationManager cannot receive location from any provider.
Can you please call requestSingleUpdate on UI thread. Do you receive any events in LocationListener?
@Zellius I have the same issue and I call requestSingleUpdate on UI thread like you said,but I did't receive any event,so wht's the problem?
@BDwuzhou Did you tried to use the LocationManager.NETWORK_PROVIDER? Do you have same issue?
Android LocationManager will not call any LocationListener's method if the device cannot receive a Location from the provider. Usually network provider works better than gps. Especially inside buildings. But it may not work too.
Does my example work on your device? Did you tried to run your code on the emulator and send fake locations? You can try to send fake location on your device too via apps.
good morning, can help me
i had created an app for control of bike tours, during the tour will be saved the coordinates of a cyclist on local database and i used RxLocationManager for catch lat and lon, but in my device lat and lon always comes 0.0.
i use GcmNetworkManager for execute in background to dribble the doze mode and kotlin, but i think that not have incompatibilities
this is my service:
` class CoordinatorService : GcmTaskService() {
} `
manifest already has:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
on logcat two lines: 0.0 0.0 ERRO
the most intresting is that in other device the same code generate lat e lon correctly, my device is android 5 and other device is android 6,
all permissions have granted and gps e wifi connected, i check this before start the service on Activity
what wrong in my device/app?