Android 在应用程序被另一个应用程序替换之前,有没有办法得到通知?
我知道Intent操作,但它的作用是在应用程序被替换后通知接收者 但事情是-在该应用程序被另一个应用程序取代之前,我想知道。 我试过这些动作Android 在应用程序被另一个应用程序替换之前,有没有办法得到通知?,android,broadcastreceiver,intentfilter,android-package-managers,Android,Broadcastreceiver,Intentfilter,Android Package Managers,我知道Intent操作,但它的作用是在应用程序被替换后通知接收者 但事情是-在该应用程序被另一个应用程序取代之前,我想知道。 我试过这些动作 <receiver android:name=".receivers.InstallReceiver" android:enabled="true" android:exported="true"> <intent-filter> <action android:
<receiver
android:name=".receivers.InstallReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_INSTALL" />
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_CHANGED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
但是没用
我想在该应用程序被另一个应用程序替换之前知道
那是不可能的,对不起
如果我想在卸载应用程序之前停止某些服务,该怎么办
当应用程序被替换或删除时,其进程将终止。该过程也将因许多其他原因终止(例如,年老、强制停止设置)。对于替换/卸载场景,应该不需要做任何特殊的操作。AFAIK,可能现在我想在卸载应用程序之前停止一些服务吗?我知道系统会自动终止服务,但不知怎么的,它正在崩溃。。现在说得通了。