[英]Android: How to get the installed App information using Broadcast receiver
我是Android新手。 我正在使用廣播接收器,它會在安裝或刪除應用程序時進行偵聽。.在安裝或刪除應用程序時,將調用廣播接收器的onReceive(context,intent) 。.現在,我需要獲取有關已安裝應用程序或已刪除(主要是程序包名稱)。
請幫助
您可以嘗試此接收者和權限。 (但這似乎僅在/ 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" />
您想要的所有信息都在Intent Extras中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.