如何知道我的应用程序从设备上卸载......? [英] How to know my app is uninstalled from the device...?
本文介绍了如何知道我的应用程序从设备上卸载......?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经安装在许多设备的应用程序。
I have an app installed in many devices.
如果应用程序是从任何设备的卸载,我需要的指示。
If app is uninstalled from any of the device I need an indication.
如何实现这一目标。
在此先感谢...!
推荐答案
我的建议会是以下。您可以拦截的意图您的应用程序卸载。简单的说下code在你的manifest文件:
My proposal will be the following. You can intercept the intent for your application uninstall. Simply put the following code in your manifest file:
<uses-permission android:name="android.permission.INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.DELETE_PACKAGES" />
<uses-permission android:name="android.permission.CLEAR_APP_CACHE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CLEAR_APP_USER_DATA" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<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" android:pathPattern="com.testpack.yourapp" />
</intent-filter>
</activity>
</application>
在此,你能以某种方式处理您的应用程序将被删除(例如,您发送电子邮件),并调用包管理器卸载程序。
After this you can somehow process that your application is going to be deleted (for instance, send you a email), and call the package manager uninstaller.
这篇关于如何知道我的应用程序从设备上卸载......?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文