我正在开发销售点的应用程序。我需要禁用或隐藏或忽略用户删除任何应用程序。 有没有办法做到这一点?
答案 0 :(得分:1)
尝试这种方式:
DevicePolicyManager dpm = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
ComponentName cn = new ComponentName(context, AdminReceiver.class);
dpm.setUninstallBlocked(cn, packageName, isEnabled);
或
dpm.addUserRestriction(cn, UserManager.DISALLOW_UNINSTALL_APPS);
需要管理员权限(或设备所有者)