So, im working on something that requires me to know when another application on the device is being updated. So my question is quite simple, does lets say YouTube or Spotif
ACTION_PACKAGE_REPLACED is action triggered when an application is being updated According to docs :
A new version of an application package has been installed, replacing an existing version that was previously installed. The data contains the name of the package.
intent.getPackage()
returns the package/application this intent was specifically addressed to but it was sent to any interested receiver, therefore, there isn't such package.
Use intent.getData()
which returns the updated package as an Uri
Add the below intent filter while registering a broadcast receiver in your Manifest.xml