2010-07-22 48 views
1
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); 
      } 
    } 

}我能赶上卸载动作在我的Android应用

做这样的事情,但不能得到notification.Reference说:

公共静态最后弦乐ACTION_PACKAGE_REMOVED

从以下版本开始:API级别1 广播操作:现有应用程序包已从设备中删除。数据包含软件包的名称。 正在安装的软件包未收到此意向

需要此意图来设置卸载密码。

有什么建议?

+0

请看到这个帖子的回答: [http://stackoverflow.com/questions/21756180/ask-for-password-before-uninstalling-application][1] [ 1]:http://stackoverflow.com/questions/21756180/ask-for-password-before-uninstalling-application – 2015-01-20 12:19:52

回答

1

摆脱“设置卸载密码”的要求。

+0

CommonsWare你写了几本关于Android的优秀书籍,但给了如此无用的答案。是否有一些可能性获得管理模式,就像Google的API例子一样,或者其他什么? – Sigrlami 2010-07-23 09:52:07

+2

@Zeldan:作为安全措施,Android非常明确地阻止应用程序作为卸载过程的一部分获取控制权,以帮助防止Windows上的恶意软件使用某些技巧。因此,任何取决于在卸载时获得控制权的功能都无法在未进行固件修改的情况下实施。当然,编写自己的固件当然是一种可能性。我不知道什么是“卸载密码”,所以不能告诉你其他的选择。 – CommonsWare 2010-07-23 11:41:11