以编程方式清除laucher默认值

编程入门 行业动态 更新时间:2024-10-24 02:34:01
本文介绍了以编程方式清除laucher默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用android.permission.SET_PREFERRED_APPLICATIONS删除默认的laucher参数(以允许用户选择其他应用程序).我在Google上搜索这是不可能的,但是有一个使用此技术的Kidzone应用程序(www.kidzoneapp/参见youtube视频).

I am trying to delete default laucher parameters (to let user choose another app) with android.permission.SET_PREFERRED_APPLICATIONS. I googled that this is not possible, but there is a kidzone app (www.kidzoneapp/ see youtube video) that uses this technology.

我现在正在尝试使用清除默认值

I am trying now to clear defaults with

pm.clearPackagePreferredActivities("com.fede.launcher");

但出现此错误:

04-20 16:05:50.272: E/AndroidRuntime(6926): Caused by: java.lang.SecurityException: Neither user 10070 nor current process has android.permission.SET_PREFERRED_APPLICATIONS.2

好吧,如果我无法清除启动器的默认值,如何检测现在的默认启动器,并打开应用程序"->管理应用程序"->启动器名称"对话框? (hothardware/articleimages/Item1525/small_move-to-sd-card-froyo.png)用户可以自己清除默认值

ok, if I am unable to clear launcher defaults, how can I detect which laucher is default now, and open Applications->Manage applications->Launcher name dialog? (hothardware/articleimages/Item1525/small_move-to-sd-card-froyo.png) And there user will be able to clear defaults himself

推荐答案

我正在尝试删除默认的laucher参数(以允许用户选择其他应用程序)

I am trying to delete default laucher parameters (to let user choose another app)

这不再可能.

有一个使用此技术的Kidzone应用程序(www.kidzoneapp/参见youtube视频).

there is a kidzone app (www.kidzoneapp/ see youtube video) that uses this technology.

在允许使用此功能的旧版Android上适用.

It does on older versions of Android, where this was allowed.

此外,它在清单中具有相同的权限.

Moreover it does it with the same permission in manifest.

如今,该权限不再使用,并且只能由使用与用于固件签名相同的签名密钥签名的应用程序来保留.

Nowadays, that permission is no longer used, and it can only be held by applications signed by the same signing key as was used to sign the firmware.

更多推荐

以编程方式清除laucher默认值

本文发布于:2023-11-24 08:55:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624553.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:默认值   方式   laucher

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!