以编程方式清除laucher默认值

问题描述:

我正在尝试使用android.permission.SET_PREFERRED_APPLICATIONS删除默认的laucher参数(以允许用户选择其他应用程序).我在Google上搜索这是不可能的,但是有一个使用此技术的Kidzone应用程序(http://www.kidzoneapp.com/参见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 (http://www.kidzoneapp.com/ 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

好吧,如果我无法清除启动器的默认值,如何检测现在的默认启动器,并打开应用程序"->管理应用程序"->启动器名称"对话框? (http://hothardware.com/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? (http://hothardware.com/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应用程序(http://www.kidzoneapp.com/参见youtube视频).

there is a kidzone app (http://www.kidzoneapp.com/ 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.