【发布时间】:2017-01-25 13:06:28
【问题描述】:
我的应用需要定期更新用户的位置,以便在 GoogleMap 上显示它们。
为了实现这一点,我使用 LocationServices.FusedLocationApi.requestLocationUpdates() 方法,并将结果发送到指定的 PendingIntent。
PendingIntent的Intent是一个BroadcastReceiver,其onReceive()方法会处理结果。
我的问题是:我是否需要在某处调用 sendBroadcast() 以便广播接收器接收结果,如果需要,在哪里?
或者,将带有 Intent 的 PendingIntent 用于 BroadcastReceiver 是否足以让结果到达他们需要的地方?
【问题讨论】:
标签: android broadcastreceiver android-pendingintent location-services