• 2022-06-04
    广播接收器的注册有两种方式:一种是代码注册://创建广播接收器: MyBroadcastReceiver receiver = new MyBroadcastReceiver();//创建过滤器并设置想要接受广播的动作: IntentFilter intentFilter = new IntentFilter("abc");//注册接收器: ______ (______ , ______ ); //最后在应用程序结束时还要取消注册广播: unregisterReceiver(receiver):