Android Question location manager lm.stopListening

hookshy

Well-Known Member
Licensed User
Longtime User
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




Thanks.
 

hookshy

Well-Known Member
Licensed User
Longtime User
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
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello Hookshy,

Refering to the help (LocationManager V1.10), shouldn't the request be : LM.requestMobileLocation or LM.requestGPSLocation ?

And to stop: LM.stopMobileListening and LM.stopGPSListening
 
Last edited:
Upvote 0
Top