我对从一个部门向一项活动发送广播有问题。
这是我在服务班子里的:
Intent intent = new Intent();
intent.setAction(BROADCAST_ACTION);
sendBroadcast(intent);
我有许多活动,在我的一项活动中,我有:
class MyBroadcast extends BroadcastReceiver {
@Override
public void onReceive(Context ctxt, Intent i) {
System.out.println("received");
}
};
我面临的问题是,我的广播接收者不收任何东西!
帮助!
EDIT:
If I have many activities how can send a broadcast message to all of them. In other words can I apply the same broadcast receiver to all the activities !?