开发者

Android: Keep GPS active

i'm having a main activity that runs a gps listener. If i'm starting a new activity the listener is destroyed. I need the gps to be still activated, also after starting the 2nd activity. Do i have to implement an own listener there, or is there another开发者_StackOverflow solution?


I recommend creating a Service that extends LocationListener. I would start your Service from your Activity using startService.

Here is an example: http://androidgps.blogspot.com/2008/09/simple-android-tracklogging-service.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜