开发者

When is advised PendingIntent vs. LocationListener on requestLocationUpdates?

you can subscribe to requestLocationUpdates via two ways

When is advised the one and when the other?


If the component needing location updates only needs updates when the component is around -- say, an activity -- I'd use the LocationListener approach.

If the component needing location updates specifically will not be around -- say, an IntentService -- I'd use the PendingIntent. You can't use the LocationListener in this case, since there is nothing in memory to be listening for locations.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜