Difference between StartActivity and SendBroadcastIntent

thedesolatesoul

Expert
Licensed User
Longtime User
There are three types of intents. Intents that start activities, intents that start services and intents that are intercepted by broadcast receivers. Depending on the target, you should use the correct "sending" method.
I see.
I used to think that StartActivity also broadcasts the intent and the OS checks for each intent filter and activates the (first) activity it finds.
However, that was wrong and StartActivity only sends the intent to the correct package/application activity and does not broadcast for everyone to listen.
SendBroadcastIntent on the other hand broadcasts the intent for any/all apps to see therefore sensitive information should not be broadcast.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…