Clear default settings

I am trying to remove the default laucher options (so that the user can select another application) using android.permission.SET_PREFERRED_APPLICATIONS . I googled that this is not possible, but there is a kidzone application (http://www.kidzoneapp.com/ see YouTube video) that uses this technology.

I am trying to clear the defaults with

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

but getting this error:

 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 

ok, if I can’t clear the default values ​​for the launch, how can I determine which laucher is used by default and open "Applications->" Application Management "->" Name of the launch window "? (http://hothardware.com /articleimages/Item1525/small_move-to-sd-card-froyo.png) And the user will be able to independently clear the default settings

0
source share
1 answer

I am trying to remove the default laucher options (so that the user can select another application)

This is no longer possible.

there is a kidzone app (http://www.kidzoneapp.com/ see YouTube video) that uses this technology.

It works in older versions of Android where it is allowed.

In addition, he does this with the same permission in the manifest.

Currently, this permission is no longer used, and it can only be stored by applications signed with the same subscription key that was used to sign the firmware.

+1
source

Source: https://habr.com/ru/post/1486753/


All Articles