Reputation: 110550
In the broadcast receiver's onReceive() method, how can I tell which app send me the Intent?
Upvotes: 1
Views: 457
Reputation: 10479
This is not the intent of how android uses Intents (no pun intended.). However, if you are sending the intent and your broadcaster is receiving the intent, you can use setExtra ( String, String) on the Intent to attach the name of the class sending the intent. Inside your onReceive, check to see if that extra is set and, if it is, check to see if the value matches your expected class.
Upvotes: 3