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.
这篇关于如何知道我的应用程序已从设备上卸载...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
沃梦达教程
本文标题为:如何知道我的应用程序已从设备上卸载...?


猜你喜欢
- GPS状态的广播接收器? 2022-01-01
- 网上有没有好的 UIScrollView 教程? 2022-01-01
- 如何在 iPhone 模拟器中重置 NSUserDefaults 数据? 2022-01-01
- 在 Iphone SDK 的导航栏上添加多个按钮 2022-01-01
- 使用自动布局向 UIScrollView 添加动态大小的视图 2022-01-01
- SetOnItemSelectedListener上的微调程序错误 2022-01-01
- URL编码Swift iOS 2022-01-01
- Xcode 7.3 中带有 UILabel 的 UIStackView 2022-01-01
- 类似于 Mail.app 的 iPad 模态视图控制器? 2022-01-01
- UITextView 内容插图 2022-01-01