我可以在Android应用中捕获卸载操作吗? [英] Can I catch uninstall action in my Android app
本文介绍了我可以在Android应用中捕获卸载操作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
public class Unistallreceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
String action = intent.getAction();
if (action == null)
Log.e("uninstall ", "Action==null!");
else if ("android.intent.action.BOOT_COMPLETED".equals(action)) {
Log.e("uninstall ", "action :"+action);
}
}
}
做类似的事,但无法得到通知。参考说:
Doing something like this, but can't get notification.Reference said :
public static final String ACTION_PACKAGE_REMOVED
public static final String ACTION_PACKAGE_REMOVED
从以下版本开始:API Level 1
广播操作:已从设备中删除现有的应用程序包。数据包含包的名称。 正在安装的软件包未收到此Intent
Since: API Level 1 Broadcast Action: An existing application package has been removed from the device. The data contains the name of the package. The package that is being installed does not receive this Intent
需要此意图来设置卸载密码。
A need this intent to set uninstall password.
任何建议??
推荐答案
摆脱设置卸载密码的要求。
Get rid of the "set uninstall password" requirement.
这篇关于我可以在Android应用中捕获卸载操作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文