locationmanager - Android: Location Manager -
run location updates different criteria 1 after another
how can run location updates using "requestforlocationupdates" diferent criteria's 1 after another.
the problem facing when run locationupdates 3 criteria's, code begins execution first criteria, seperate thread seems initiated waits location change , works listener. before removeupdates first criteria, have second criteria begining execution in main thread , again requesting location updates using new criteria. result can run last criteria.
the locationmanager.getbestprovider() function returns best provider available. if there isn't provider matching criteria, loosened till provider found. can see definition of criteria upper boarder.
if wanna use different criteria, can check in locationlistener.onstatuschanged() callback provider actual in use. if don't provider (because it's network , wanna gps f.e.) there place start new request provider.
Comments
Post a Comment