On Thu, Oct 3, 2013 at 5:32 PM, Alex Belyaev <[email protected]>wrote:
> What *LocationManager *does, when we call *requestLocationUpdates* and > provide a *PendingIntent*? It sends us locations back with broadcasts. > It sends locations back with broadcasts ... *if you specify a broadcast for your PendingIntent*. You can also elect to start a Service or Activity, can't you? > So basically *LocationManager *needs only an action, that is the only > thing you need to make a broadcast across the system. > To make Intents unique, you also need to specify Data and Category. You are also assuming sending a broadcast is the only action one would want to take in response to a location update > So I'm asking, why it need a whole *PendingIntent*? > Because an Action is not sufficient to explicitly tell the system how you want to respond to an location update. The PendingIntent specifies the component to start (Broadcast Receiver, Activity, Service), and provides extra information for that component to respond to the Intent (Data, Category, extras). Disclaimer: this is all based on my reading of the docs and my understanding of PendingIntents. I have not used this particular method myself, so I could be wrong here. ------------------------------------------------------------------------------------------------- TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

