是否有可能拦截应用程序卸载? [英] Is it possible to intercept app uninstall?

查看:141
本文介绍了是否有可能拦截应用程序卸载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能拦截应用程序卸载,并提出一些工作?例如。我的应用程序修改设备的一些文件,所以卸载刚回退我的应用程序中所做的更改之前,这将是整齐的。

Is it possible to intercept app uninstall and make some job? E.g. my app modifies some files of device, so it would be neat before uninstalling just rollback changes made by my app.

任何提示,想法?

推荐答案

您谈论类似问题

<一个href="http://stackoverflow.com/questions/8633761/listen-broadcast-before-application-uninstall">Listen广播应用程序之前卸载

然后当说,你必须使用意向过滤器删除在上面的链接给出。

Then as said you have to use the intent-filter for delete as given in the above link.

<activity
    android:name=".UninstallIntentActivity"
    android:label="@string/app_name" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <action android:name="android.intent.action.DELETE" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:scheme="package"  />
    </intent-filter>
</activity>

,当你得到通知,做任何你想要的。

and when you get notified , do whatever you want.

这篇关于是否有可能拦截应用程序卸载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆