Android中Activity类向 BroadcastReceiver类传递数据要怎么写??

2025-01-01 05:58:40
推荐回答(1个)
回答1:

发送广播:
private void sendCurrentBoadcast(){

Intent intent=new Intent();
intent.setAction(BROADCAST_ACTION);
//通过Intent对象传递数据
intent.putExtra("msg","欢迎加入android开发团队!");
sendBroadcast(intent);

}