Android: How to get the installed App information using Broadcast receiver

前端 未结 2 1041
我在风中等你
我在风中等你 2021-01-28 11:24

I am new to 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 onRe

相关标签:
2条回答
  • 2021-01-28 11:48

    All the information you want is in the Intent extras.

    Look at How to find the package name which has been uninstalled when using Intent.ACTION_PACKAGE_REMOVED

    0 讨论(0)
  • 2021-01-28 11:58

    You can try this receiver and permission. (But this seem only work in /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" />
    
    0 讨论(0)
提交回复
热议问题