1、传输信息小,速度慢,广播频率不高的情形下使用
onMessage为监听到消息时调用
public class MyBroadcastReceiver extends BroadcastReceiver { public static final String ACTION = "cn.eoe.l004usingboardcastreceiver.intent.action.myBC"; @Override public void onReceive(Context arg0, Intent intent) { System.out.println("onReceive"); System.out.println(intent.getStringExtra("msg")); } }