In my application I am listening for following 3 intents by using broadcast receiver.
ACTION_PACKAGE_REPLACED
ACTION_PACKAGE_REMOVED
ACTION_PACKAGE_ADDED
The problem is that whenever I reinstall some application First I get
ACTION_PACKAGE_REMOVED then I get ACTION_PACKAGE_ADDED then I get ACTION_PACKAGE_REPLACED.
Is there any way to know that in reinstallation of application the ACTION_PACKAGE_REMOVED and ACTION_PACKAGE_ADDED intents belongs to ACTION_PACKAGE_REPLACED. I mean these are not the intents when only application is removed and installed respectively.
Thx Dalvin
This may be too late, but I was looking for something similar and came across the extra EXTRA_REPLACING which will be present in the intent ACTION_PACKAGE_REMOVED if it will be immediately followed by an Add.
I figured this extra could be used to differentiate between actual replacement and only additions/removals. And sure enough, I came across this post on SO which does the exact same thing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With