前言
欢迎大家我分享和推荐好用的代码段~~
声明
欢迎转载,但请保留文章原始出处:
CSDN:http://www.csdn.net
雨季o莫忧离:http://blog.csdn.net/luckkof
正文
Intent.ACTION_AIRPLANE_MODE_CHANGED;
//关闭或打开飞行模式时的广播
Intent.ACTION_BATTERY_CHANGED;
//充电状态,或者电池的电量发生变化
//电池的充电状态、电荷级别改变,不能通过组建声明接收这个广播,只有通过Context.registerReceiver()注册
Intent.ACTION_BATTERY_LOW;
//表示电池电量低
Intent.ACTION_BATTERY_OKAY;
//表示电池电量充足,即从电池电量低变化到饱满时会发出广播
Intent.ACTION_BOOT_COMPLETED;
//在系统启动完成后,这个动作被广播一次(只有一次)。
Intent.ACTION_CAMERA_BUTTON;
//按下照相时的拍照按键(硬件按键)时发出的广播
Intent.ACTION_CLOSE_SYSTEM_DIALOGS;
//当屏幕超时进行锁屏时,当用户按下电源按钮,长按或短按(不管有没跳出话框),进行锁屏时,android系统都会广播此Action消息
Intent.ACTION_CONFIGURATION_CHANGED;
//设备当前设置被改变时发出的广播(包括的改变:界面语言,设备方向,等,请参考Configuration.java)
Intent.ACTION_DATE_CHANGED;
//设备日期发生改变时会发出此广播
Intent.ACTION_DEVICE_STORAGE_LOW;
//设备内存不足时发出的广播,此广播只能由系统使用,其它APP不可用?
Intent.ACTION_DEVICE_STORAGE_OK;
//设备内存从不足到充足时发出的广播,此广播只能由系统使用,其它APP不可用?
Intent.ACTION_DOCK_EVENT;
//
//发出此广播的地方frameworks\base\services\java\com\android\server\DockObserver.java
Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE;
移动APP完成之后,发出的广播(移动是指:APP2SD)
Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE;
//正在移动APP时,发出的广播(移动是指:APP2SD)
Intent.ACTION_GTALK_SERVICE_CONNECTED;
//Gtalk已建立连接时发出的广播
Intent.ACTION_GTALK_SERVICE_DISCONNECTED;
//Gtalk已断开连接时发出的广播
Intent.ACTION_HEADSET_PLUG;
//在耳机口上插入耳机时发出的广播
Intent.ACTION_INPUT_METHOD_CHANGED;
//改变输入法时发出的广播
Intent.ACTION_LOCALE_CHANGED;
//设备当前区域设置已更改时发出的广播
Intent.ACTION_MANAGE_PACKAGE_STORAGE;
//
Intent.ACTION_MEDIA_BAD_REMOVAL;
//未正确移除SD卡(正确移除SD卡的方法:设置--SD卡和设备内存--卸载SD卡),但已把SD卡取出来时发出的广播
//广播:扩展介质(扩展卡)已经从 SD 卡插槽拔出,但是挂载点 (mount point) 还没解除 (unmount)
Intent.ACTION_MEDIA_BUTTON;
//按下"Media Button" 按键时发出的广播,假如有"Media Button"按键的话(硬件按键)
Intent.ACTION_MEDIA_CHECKING;
//插入外部储存装置,比如SD卡时,系统会检验SD卡,此时发出的广播?
Intent.ACTION_MEDIA_EJECT;
//已拔掉外部大容量储存设备发出的广播(比如SD卡,或移动硬盘),不管有没有正确卸载都会发出此广播?
//广播:用户想要移除扩展介质(拔掉扩展卡)。
Intent.ACTION_MEDIA_MOUNTED;
//插入SD卡并且已正确安装(识别)时发出的广播
//广播:扩展介质被插入,而且已经被挂载。
Intent.ACTION_MEDIA_NOFS;
//
Intent.ACTION_MEDIA_REMOVED;
//外部储存设备已被移除,不管有没正确卸载,都会发出此广播?
// 广播:扩展介质被移除。
Intent.ACTION_MEDIA_SCANNER_FINISHED;
//广播:已经扫描完介质的一个目录
Intent.ACTION_MEDIA_SCANNER_SCAN_FILE;
//
Intent.ACTION_MEDIA_SCANNER_STARTED;
//广播:开始扫描介质的一个目录
Intent.ACTION_MEDIA_SHARED;
// 广播:扩展介质的挂载被解除 (unmount),因为它已经作为 USB 大容量存储被共享。
Intent.ACTION_MEDIA_UNMOUNTABLE;
//
Intent.ACTION_MEDIA_UNMOUNTED
// 广播:扩展介质存在,但是还没有被挂载 (mount)。
Intent.ACTION_NEW_OUTGOING_CALL;
//
Intent.ACTION_PACKAGE_ADDED;
//成功的安装APK之后
//广播:设备上新安装了一个应用程序包。
//一个新应用包已经安装在设备上,数据包括包名(最新安装的包程序不能接收到这个广播)
Intent.ACTION_PACKAGE_CHANGED;
//一个已存在的应用程序包已经改变,包括包名
Intent.ACTION_PACKAGE_DATA_CLEARED;
//清除一个应用程序的数据时发出的广播(在设置--应用管理--选中某个应用,之后点清除数据时?)
//用户已经清除一个包的数据,包括包名(清除包程序不能接收到这个广播)
Intent.ACTION_PACKAGE_INSTALL;
//触发一个下载并且完成安装时发出的广播,比如在电子市场里下载应用?
//
Intent.ACTION_PACKAGE_REMOVED;
//成功的删除某个APK之后发出的广播
//一个已存在的应用程序包已经从设备上移除,包括包名(正在被安装的包程序不能接收到这个广播)
Intent.ACTION_PACKAGE_REPLACED;
//替换一个现有的安装包时发出的广播(不管现在安装的APP比之前的新还是旧,都会发出此广播?)
Intent.ACTION_PACKAGE_RESTARTED;
//用户重新开始一个包,包的所有进程将被杀死,所有与其联系的运行时间状态应该被移除,包括包名(重新开始包程序不能接收到这个广播)
Intent.ACTION_POWER_CONNECTED;
//插上外部电源时发出的广播
Intent.ACTION_POWER_DISCONNECTED;
//已断开外部电源连接时发出的广播
Intent.ACTION_PROVIDER_CHANGED;
//
Intent.ACTION_REBOOT;
//重启设备时的广播
Intent.ACTION_SCREEN_OFF;
//屏幕被关闭之后的广播
Intent.ACTION_SCREEN_ON;
//屏幕被打开之后的广播
Intent.ACTION_SHUTDOWN;
//关闭系统时发出的广播
Intent.ACTION_TIMEZONE_CHANGED;
//时区发生改变时发出的广播
Intent.ACTION_TIME_CHANGED;
//时间被设置时发出的广播
Intent.ACTION_TIME_TICK;
//广播:当前时间已经变化(正常的时间流逝)。
//当前时间改变,每分钟都发送,不能通过组件声明来接收,只有通过Context.registerReceiver()方法来注册
Intent.ACTION_UID_REMOVED;
//一个用户ID已经从系统中移除发出的广播
//
Intent.ACTION_UMS_CONNECTED;
//设备已进入USB大容量储存状态时发出的广播?
Intent.ACTION_UMS_DISCONNECTED;
//设备已从USB大容量储存状态转为正常状态时发出的广播?
Intent.ACTION_USER_PRESENT;
//
Intent.ACTION_WALLPAPER_CHANGED;
//设备墙纸已改变时发出的广播
<!-- 关于程序包事件 -->
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_CHANGED" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<action android:name="android.intent.action.PACKAGE_DATA_CLEARED" />
<action android:name="android.intent.action.PACKAGE_INSTALL" />
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<action android:name="android.intent.action.PACKAGE_RESTARTED" />
<data android:scheme="package"></data>
</intent-filter>
<!-- 隐秘数字事件 -->
<intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE"></action>
<data android:scheme="android_secret_code" android:host="0101"></data>
</intent-filter>
<!--
收发短信、SIM卡存储已满、WAP PUSH的接收事件,<br/>
需要android.permission.RECEIVER_SMS及android.permission.RECEIVER_MMS权限
-->
<intent-filter>
<!-- 无法模仿 -->
<action android:name="android.provider.Telephony.SIM_FULL"></action>
<!--
SMS_REJECTED:An incoming SMS has been rejected by the telephony
framework. This intent is sent in lieu of any of the
RECEIVED_ACTION intents.(无法模仿)
-->
<action android:name="android.provider.Telephony.SMS_REJECTED"></action>
<action android:name="android.provider.Telephony.SMS_RECEIVED"></action>
</intent-filter>
<intent-filter>
<!--
向10086发送短信012345即可有WAP_PUSH,需要android.permission.RECEIVE_WAP_PUSH权限
-->
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED"></action>
<data android:mimeType="application/vnd.wap.sic"></data>
</intent-filter>
<intent-filter>
<!--
向10086发送短信012345即可有WAP_PUSH,需要android.permission.RECEIVE_WAP_PUSH权限,未证实
-->
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED"></action>
<data android:mimeType="application/vnd.wap.sic"></data>
</intent-filter>
<intent-filter>
<!-- 彩信,需要android.permission.RECEIVE_WAP_PUSH权限,未证实 -->
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED"></action>
<data android:mimeType="application/vnd.wap.mms-message"></data>
</intent-filter>
<intent-filter>
<!-- 开机自启动,需要android.permission.RECEIVE_BOOT_COMPLETED -->
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
<action android:name="android.intent.action.PRE_BOOT_COMPLETED"></action>
<action android:name="android.intent.action.REBOOT"></action>
</intent-filter>
<intent-filter>
<!-- 针对摩托罗拉等有相机快捷键的手机 -->
<action android:name="android.intent.action.CAMERA_BUTTON"></action>
<action android:name="android.intent.action.CALL_BUTTON"></action>
</intent-filter>
<intent-filter>
<!-- 设置时间、时区时触发 -->
<action android:name="android.intent.action.TIME_SET"></action>
<action android:name="android.intent.action.TIMEZONE_CHANGED"></action>
<action android:name="android.intent.action.LOCALE_CHANGED"></action>
<action android:name="android.intent.action.DATE_CHANGED"></action>
</intent-filter>
<intent-filter>
<!-- 来去电事件监听,需要android.permission.READ_PHONE_STATE权限 -->
<action android:name="android.intent.action.PHONE_STATE"></action>
<!-- 开关Wifi时触发 -->
<action android:name="android.net.wifi.WIFI_STATE_CHANGED"></action>
<!-- 电话的信号强度已经改变。 -->
<action android:name="android.intent.action.SIG_STR"></action>
<!-- 电话服务的状态已经改变。(调为飞行模式可观察到变化) -->
<action android:name="android.intent.action.SERVICE_STATE"></action>
<!-- 当改变AIRPLANE_MODE时触发 -->
<action android:name="android.intent.action.AIRPLANE_MODE"></action>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.WALLPAPER_CHANGED"></action>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.BATTERY_CHANGED"></action>
<action android:name="android.intent.action.BATTERY_LOW"></action>
<action android:name="android.intent.action.BATTERY_OKAY"></action>
</intent-filter>
<intent-filter>
<!-- 与充电器或USB连接时触发 -->
<action android:name="android.intent.action.ACTION_POWER_CONNECTED"></action>
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"></action>
<action android:name="android.intent.action.POWER_USAGE_SUMMARY"></action>
<action android:name="android.intent.action.ACTION_SHUTDOWN"></action>
</intent-filter>
<intent-filter>
<!-- (USB mass storage)未模拟 -->
<action android:name="android.intent.action.UMS_CONNECTED"></action>
<action android:name="android.intent.action.UMS_DISCONNECTED"></action>
</intent-filter>
<intent-filter>
<!-- 未模拟 -->
<action android:name="android.intent.action.DEVICE_STORAGE_LOW"></action>
<action android:name="android.intent.action.DEVICE_STORAGE_OK"></action>
</intent-filter>
<intent-filter>
<!-- 呼叫转接状态已被更改,未模拟 -->
<action android:name="android.intent.action.CFF"></action>
<!-- 不明其意,未模拟 -->
<action android:name="android.intent.action.DATA_STATE"></action>
<!-- 不明其意,未模拟 -->
<action android:name="android.intent.action.DATA_ACTIVITY"></action>
</intent-filter>
<intent-filter>
<!-- 不明其意,未模拟 -->
<action android:name="android.intent.action.CONFIGURATION_CHANGED"></action>
</intent-filter>
<intent-filter>
<!-- 以下内容有反应,规律不明,适用于电子市场 -->
<!-- 取消所有被挂起的 (pending) 更新下载。 -->
<action android:name="android.server.checkin.FOTA_CANCEL"></action>
<!-- 更新已经被确认,马上就要开始安装。 -->
<action android:name="android.server.checkin.FOTA_INSTALL"></action>
<!-- 更新已经被下载,可以开始安装。 -->
<action android:name="android.server.checkin.FOTA_READY"></action>
<!-- 恢复已经停止的更新下载。 -->
<action android:name="android.server.checkin.FOTA_RESTART"></action>
<!-- 通过 OTA 下载并安装操作系统更新。 -->
<action android:name="android.server.checkin.FOTA_UPDATE"></action>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SYNC_STATE_CHANGED"></action>
<action android:name="com.android.sync.SYNC_CONN_STATUS_CHANGED"></action>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.HEADSET_PLUG"></action>
</intent-filter>
<intent-filter>
<!-- 选择静音时触发 -->
<action android:name="android.media.RINGER_MODE_CHANGED"></action>
</intent-filter>
<intent-filter>
<!-- 扩展介质(扩展卡)已经从 SD 卡插槽拔出,但是挂载点 (mount point) 还没解除 (unmount)。 -->
<action android:name="android.intent.action.MEDIA_BAD_REMOVAL"></action>
<!-- 用户想要移除扩展介质(拔掉扩展卡)。 -->
<action android:name="android.intent.action.MEDIA_EJECT"></action>
<!-- 扩展介质被插入,而且已经被挂载。 -->
<action android:name="android.intent.action.MEDIA_MOUNTED"></action>
<!-- 扩展介质被移除。 -->
<action android:name="android.intent.action.MEDIA_REMOVED"></action>
<!-- 已经扫描完介质的一个目录。 -->
<action android:name="android.intent.action.MEDIA_SCANNER_FINISHED"></action>
<!-- 开始扫描介质的一个目录 -->
<action android:name="android.intent.action.MEDIA_SCANNER_STARTED"></action>
<!-- 扩展介质的挂载被解除 (unmount),因为它已经作为 USB 大容量存储被共享。 -->
<action android:name="android.intent.action.MEDIA_SCANNER_SHARED"></action>
<!-- 扩展介质存在,但是还没有被挂载 (mount)。 -->
<action android:name="android.intent.action.MEDIA_UNMOUNTED"></action>
</intent-filter>
<intent-filter>
<!-- 耳机按键 -->
<action android:name="android.intent.action.MEDIA_BUTTON"></action>
<action android:name="android.media.AUDIO_BECOMING_NOISY" />
</intent-filter>
<intent-filter>
<!-- 设备收到了新的网络 "tickle" 通知,未模拟 -->
<action android:name="android.intent.action.NETWORK_TICKLE_RECEIVED"></action>
</intent-filter>
<intent-filter>
<!-- 条件不允许,未模拟 -->
<!-- 更新将要(真正)被安装。 -->
<action android:name="android.intent.action.PROVIDER_CHANGED"></action>
<!-- 要求 polling of provisioning service 下载最新的设置。 -->
<action android:name="android.intent.action.PROVISIONING_CHECK"></action>
</intent-filter>
<!-- 其它广播事件,不明其意,未模拟 -->
<intent-filter>
<!-- XMPP 连接已经被建立。 -->
<action android:name="android.intent.action.XMPP_CONNECTED"></action>
<!-- XMPP 连接已经被断开。 -->
<action android:name="andandroid.intent.action.XMPP_DI"></action>
<!-- 统计信息服务的状态已经改变。 -->
<action android:name="android.intent.action.STATISTICS_STATE_CHANGED"></action>
<!-- 要求 receivers 报告自己的统计信息。 -->
<action android:name="android.intent.action.STATISTICS_REPORT"></action>
<action android:name="android.intent.action.GTALK_DISCONNECTED"></action>
<action android:name="android.intent.action.GTALK_CONNECTED"></action>
<action android:name="android.intent.action.GET_CONTENT"></action>
<action android:name="android.intent.action.MANAGE_PACKAGE_STORAGE"></action>
<action android:name="android.intent.action.UID_REMOVED"></action>
<action android:name="android.intent.action.USER_PRESENT"></action>
</intent-filter>