Hi , Does every one has any experience using functions of location manager and could
guide me how to use loaction manager stop listening function .
When should we use it ? and what is the purpose?
I had problems , services crashed all the time when calling lm.stoplistening
B4X:
Sub Service_Create
lm.Initialize("location")
End Sub
sub Service_start
if condition then
lm.requestlocation
else
lm.stoplistening ' this seems to be improper use
end if
Caused by: java.lang.IllegalArgumentException: listener==null
at android.location.LocationManager.removeUpdates(LocationManager.java:864)
at com.rootsoft.locationmanager.LocationManager1.stopListening(LocationManager1.java:90)
at hs.easy.romt.hsman._service_start(hsman.java:405)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:167)
... 14 more