hookshy Well-Known Member Licensed User Longtime User Oct 24, 2013 #1 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 Code: Copy 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.
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 Code: Copy 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.
Erel B4X founder Staff member Licensed User Longtime User Oct 24, 2013 #2 Which error did you get (from the logs)? Upvote 0
hookshy Well-Known Member Licensed User Longtime User Oct 24, 2013 #3 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
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
lemonisdead Well-Known Member Licensed User Longtime User Oct 24, 2013 #4 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: Oct 24, 2013 Upvote 0
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
hookshy Well-Known Member Licensed User Longtime User Oct 24, 2013 #5 I am using LocationManager v1.00 ..perhaps the request you mentioned si for other library ...locationmanger Extended or gps Upvote 0
I am using LocationManager v1.00 ..perhaps the request you mentioned si for other library ...locationmanger Extended or gps
lemonisdead Well-Known Member Licensed User Longtime User Oct 24, 2013 #6 No, I use the V1.10 (available from the same post) Upvote 0
hookshy Well-Known Member Licensed User Longtime User Nov 11, 2013 #8 I found that you must call lm.requestlocation first , otherwise you have no listener to stop it Upvote 0