android - requestLocationUpdates vs Location Listener -


what difference between using location manager object requestlocationupdates() vs using locationlistener? both same thing , work same way? whats advantage of 1 on other?

locationmanager lm = (locationmanager)getsystemservice(context.location_service);  lm.requestlocationupdates(locationmanager.gps_provicer, 0, 0, new locationlistener()){ //all appropriate methods here } 

vs.

locationlistener mylocationlistener = new locationlistener(){ // appropriate methods here } 

your question technically incorrect. locationmanager registers listener via requestlocationupdates. listener callback when location manager realizes timeout or distance travel has occurred. in case location listener called immediately.

but beware, location manager request updates 0,0 parameters not known instantaneous. there may delay.

so question on what difference incorrect. asking difference between print this , system.out.println() :)


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -