如何将orderedBroadcast发送到特定接收器?我正在广播ACTION_MEDIA_BUTTON,只想要一个特定的应用程序(例如Winamp)来接收它。我不希望潘多拉偷走它。有没有办法明确定义接收者是谁?
void sendBroadcast() {
Intent i = new Intent(Intent.ACTION_MEDIA_BUTTON);
synchronized (this) {
i.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_DOWN, theKeyEvent));
ctx.sendOrderedBroadcast(i, null);
i.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_UP, theKeyEvent));
ctx.sendOrderedBroadcast(i, null);
}
}