[英]Android: How to get the installed App information using Broadcast receiver
I am new to android. 我是Android新手。 I am using a Broadcast receiver which listens when a app is installed or removed.. When a app is installed or removed my Broadcast Receivers's onReceive(context,intent) will be called.. Now i need to get the info about the application installed or removed (Mainly the package name)..
我正在使用广播接收器,它会在安装或删除应用程序时进行侦听。.在安装或删除应用程序时,将调用广播接收器的onReceive(context,intent) 。.现在,我需要获取有关已安装应用程序或已删除(主要是程序包名称)。
Plz help 请帮助
You can try this receiver and permission. 您可以尝试此接收者和权限。 (But this seem only work in /system/app)^^"
(但这似乎仅在/ system / app中有效)^^“
<receiver
android:name="com.your.receiver"
android:enabled="true"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package"/>
</intent-filter>
</receiver>
<uses-permission android:name="android.permission.BROADCAST_PACKAGE_REMOVED" />
All the information you want is in the Intent extras. 您想要的所有信息都在Intent Extras中。
Look at How to find the package name which has been uninstalled when using Intent.ACTION_PACKAGE_REMOVED 查看使用Intent.ACTION_PACKAGE_REMOVED时如何查找已卸载的软件包名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.