I've been trying to broadcast an intent to a single component.  For
instance, I have two apps, ExecMount and IntentTest, with manifest
intent filters that watch for android.intent.action.MEDIA_MOUNTED.  I
do:

  am broadcast -a android.intent.action.MEDIA_MOUNTED -n
mobi.pruss.execmount/mobi.pruss.execmount.OnMount file:///mnt/storage

Result: every package registered for it gets a MEDIA_MOUNTED intent.
In particular, my IntentTest's broadcast receiver fires, and
getIntent() returns "mobi.pruss.intenttest/
mobi.pruss.intenttest.IntentReceiver".


Why do I care?  Well, I'm doing a root app that needs to notify some
other package that they have been replaced (I don't currently want to
go into the long story of what I am up to, but it's part of a user
profile switcher).  For API below 12, that's easy: I just broadcast
the PACKAGE_REPLACED intent to everybody.  But it would be nice to
additionally send MY_PACKAGE_REPLACED for API 12 directly to the
package.  But I can't.  When I broadcast MY_PACKAGE_RECEIVED to a
particular component with am, it goes out to everybody.

-- 
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

Reply via email to