В чем разница между двумя намерениями: Intent.ACTION_PACKAGE_REPLACED, Intent.ACTION_MY_PACKAGE_REPLACED? ⇐ Android
В чем разница между двумя намерениями: Intent.ACTION_PACKAGE_REPLACED, Intent.ACTION_MY_PACKAGE_REPLACED?
In which cases each of them should be used? For example, to trigger some function inside the package upon this package update (installing over existing version of the package) which one should be used? Is it enough for that to use only one ACTION_MY_PACKAGE_REPLACED?
Description from official documentation for Intent.ACTION_PACKAGE_REPLACED:
Added in API level 3
public static final String ACTION_PACKAGE_REPLACED
Broadcast Action: 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.
May include the following extras: EXTRA_UID containing the integer uid assigned to the new package.
This is a protected intent that can only be sent by the system.
Constant Value: "android.intent.action.PACKAGE_REPLACED"
Description for Intent.ACTION_MY_PACKAGE_REPLACED:
Added in API level 12
public static final String ACTION_MY_PACKAGE_REPLACED
Broadcast Action: A new version of your application has been installed over an existing one. This is only sent to the application that was replaced. It does not contain any additional data; to receive it, just use an intent filter for this action.
This is a protected intent that can only be sent by the system.
Constant Value: "android.intent.action.MY_PACKAGE_REPLACED"
Источник: https://stackoverflow.com/questions/781 ... laced-inte
In which cases each of them should be used? For example, to trigger some function inside the package upon this package update (installing over existing version of the package) which one should be used? Is it enough for that to use only one ACTION_MY_PACKAGE_REPLACED?
Description from official documentation for Intent.ACTION_PACKAGE_REPLACED:
Added in API level 3
public static final String ACTION_PACKAGE_REPLACED
Broadcast Action: 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.
May include the following extras: EXTRA_UID containing the integer uid assigned to the new package.
This is a protected intent that can only be sent by the system.
Constant Value: "android.intent.action.PACKAGE_REPLACED"
Description for Intent.ACTION_MY_PACKAGE_REPLACED:
Added in API level 12
public static final String ACTION_MY_PACKAGE_REPLACED
Broadcast Action: A new version of your application has been installed over an existing one. This is only sent to the application that was replaced. It does not contain any additional data; to receive it, just use an intent filter for this action.
This is a protected intent that can only be sent by the system.
Constant Value: "android.intent.action.MY_PACKAGE_REPLACED"
Источник: https://stackoverflow.com/questions/781 ... laced-inte
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Intent.action == "Android.app.action.profile_provisioning_complete" не стрельба
Anonymous » » в форуме Android - 0 Ответы
- 37 Просмотры
-
Последнее сообщение Anonymous
-