简体   繁体   中英

How to get current location in background service in android

I am using custom GoogleLocationClient for getting the location in the entire project. there is a constructor with two parameters, one is activity and another is Listener, now I want to get the location in background service with using the same class, how to achieve this can any body help me out,

here is a constructor with two parameters, one is activity and another is Listener, now I want to get the location in background service with using the same class

It actually needs a context not activity exactly.

Anyways, you can follow the google samples of location

https://github.com/googlesamples/android-play-location

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM