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.
如何实现这一点.
提前谢谢...!
推荐答案
我的建议如下.您可以拦截应用程序卸载的意图.只需将以下代码放入清单文件中:
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.
这篇关于如何知道我的应用程序已从设备上卸载...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何知道我的应用程序已从设备上卸载...?


基础教程推荐
- 如何使用 YouTube API V3? 2022-01-01
- 在 iOS 上默认是 char 签名还是 unsigned? 2022-01-01
- :hover 状态不会在 iOS 上结束 2022-01-01
- Android文本颜色不会改变颜色 2022-01-01
- Android ViewPager:在 ViewPager 中更新屏幕外但缓存的片段 2022-01-01
- LocationClient 与 LocationManager 2022-01-01
- 固定小数的Android Money Input 2022-01-01
- 如何使 UINavigationBar 背景透明? 2022-01-01
- 使用 Ryzen 处理器同时运行 WSL2 和 Android Studio 2022-01-01
- “让"到底是怎么回事?关键字在 Swift 中的作用? 2022-01-01