Thursday, 15 September 2011

android - LocationManager.getSingleUpdate() not performing any callback - why? -



android - LocationManager.getSingleUpdate() not performing any callback - why? -

so code worked on friday:

public void requestlocationupdate() { criteria criteria = new criteria(); criteria.setaccuracy(criteria.accuracy_coarse); intent updateintent = new intent(single_location_update_action); pendingintent singleupdatepi = pendingintent.getbroadcast(_context, 0, updateintent, pendingintent.flag_update_current); intentfilter locintentfilter = new intentfilter(single_location_update_action); singleupdatereceiver receiver = new singleupdatereceiver(); getapplicationcontext().registerreceiver(receiver, locintentfilter); locationmanager.requestsingleupdate(criteria, singleupdatepi); } class singleupdatereceiver extends broadcastreceiver { @override public void onreceive(context context, intent intent) { // ... never invoked } }

today, onreceive() not invoked. there reason why shouldn't work today? thing changed i'm on different wifi router now.

i can see couple of suspicious lines in logcat:

06-23 15:10:36.540 709-7716/? d/locationmanagerservice﹕ request 430483d8 fused request[accuracy_block fused requested=+10m0s0ms fastest=+10m0s0ms num=1] com.nilzor.app(10195) 06-23 15:10:36.540 709-7716/? d/locationmanagerservice﹕ provider request: fused providerrequest[on interval=+10m0s0ms]

...don't know if relevant?

the documentation of requestsingleupdate points me requestlocationupdates, 1 time again tells me might take while first update. true requestsingleupdate? on friday, callback fired within sec of request. today i've tried 10+ times , havent fired once. 5 minutes counting post now.

when connect wi-fi coordinates router. not matter located, in wi-fi area/place utilize real gps, or gps spoiler.

android

No comments:

Post a Comment