String android.content.Intent.ACTION_PACKAGE_CHANGED = "android.intent.action.PACKAGE_CHANGED"
Broadcast Action: An existing application package has been changed (e.g. a component has been enabled or disabled). The data contains the name of the package.
* EXTRA_UID containing the integer uid assigned to the package.
* EXTRA_CHANGED_COMPONENT_NAME_LIST containing the class name of the changed components.
* EXTRA_DONT_KILL_APP containing boolean field to override the default action of restarting the application.
This is a protected intent that can only be sent by the system.
------------------
当一个应用被改变时会触发这个广播,比如这个应用被设置为不可用或可用时。其实我到现在还不知道这个包在哪里用过,我看过launcher应用中用了这东东,但测试了下,发现重新安装应用也不会触发这个广播,而是先删除后增加。
在这个change广播中,intent包括如下数据:
1.被改变的应用的包名
2.被改变的应用的ID
3.被改变的应用的类名列表
4.是否重起这个应用
这个广播只能由系统发出。
分享到:
相关推荐
恢复已经停止的更新下载。 'android.server.checkin.FOTA_RESTART' 通过 OTA 下载并安装操作系统更新。 'android.server.checkin.FOTA_UPDATE' 用户按下了'Media Button'。...'android.intent.action.PACKAGE_ADDED'
接收系统的时间流逝的广播,屏幕开启关闭的广播,电量改变的广播。这些广播在清单文件里注册时,看不到效果。在这个例子中通过在一个服务里面用代码注册的方式,成功接收了这些广播。
Intent intent = new Intent("android.intent.action.SILENT_PACKAGE_INSTALL"); intent.putExtra("silent_install_file", "/sdcard/Helloworld.apk"); intent.putExtra("silent_install_auto_start", true);//...
android.intent.action.PACKAGE_REMOVED和android.intent.action.PACKAGE_ADDED 可以监听别的应用被安装卸载,但不能监听自己被卸载啊。 监听自己被卸载通过前辈们探索发现,只能通过监听系统卸载log如:act=...
BATTERY_CHANGED_ACTION 充电状态,或者电池的电量发生变化 "android.intent.action.BATTERY_CHANGED" BOOT_COMPLETED_ACTION 在系统启动后,这个动作被广播一次(只有一次) "android.intent.action.BOOT_COMPLETED" ...
Android 屏幕唤醒 + 屏幕解锁 + 开机服务监听(android.intent.action.BOOT_COMPLET)添加权限:{//开机监听<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/><uses-permission android...
Android Intent Action
returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri); 7,播放 Uri playUri = Uri.parse("file:///sdcard/download/everything.mp3"); returnIt = new Intent(Intent.ACTION_VIEW, playUri); 8,调用发...
如果要监听电池的状态改变,需要动态注册:android.intent.action.BATTERY_CHANGED,收到Action后可以根据对应的Key获取你需要的信息,更详细信息可以参考以下例子中的BatteryChangedReceiver类 具体代码如下所示: ...
其实在系统的文件管理器中,这应该是我们常用的功能(包括文件的打开Intent.ACTION_VIEW)。 下面列出一个简单的分享方式 Intent shareIntent = new Intent(); shareIntent.setAction(Intent.ACTION_SEND); ...
android intent和intent action大全
获取系统图片的简单示例,使用Intent.ACTION_GET_CONTENT 和 MediaStore两种方式获取图片以及其真正的系统所在的位置
android Action call 拨打电话 Intent.ACTION.CALL
android intent
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.VOICE_LAUNCH" /> <category android:...
ex07_activity_intent 介绍在android中如何使用intent
Android_intent_大全 Android_intent_大全
intent_action大全