0

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");

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 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

Cœur
  • 37,241
  • 25
  • 195
  • 267
POMATu
  • 3,422
  • 7
  • 30
  • 42
  • Possible duplicate of [How to show 'Clear Defaults' programmatically?](http://stackoverflow.com/questions/15802352/how-to-show-clear-defaults-programmatically) – CrandellWS Jan 13 '17 at 12:09

1 Answers1

1

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

That is no longer possible.

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

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.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • @POMATu: I am assuming that what you refer to as a "launcher" is what the rest of use refer to as a "home screen". In that case, use `PackageManager` and `resolveActivity()` with a `HOME` `Intent` to find out what the home screen implementation is. On API Level 9 and higher, you can use `ACTION_APPLICATION_DETAILS_SETTINGS` to bring up the details screen on a given package. – CommonsWare Apr 20 '12 at 13:19
  • Unfortunately, I am using api level 8. So it won't work on this api version? – POMATu Apr 20 '12 at 13:21
  • @POMATu: For the API Level 8 devices, the best you can do is take them to the Manage Applications screen via `ACTION_APPLICATION_SETTINGS`. – CommonsWare Apr 20 '12 at 13:21
  • Kidzone app shows exactly needed screen (where the clear defaults button is), even on api level 8 (froyo) – POMATu Apr 20 '12 at 13:23
  • @POMATu: Then they are doing so using some undocumented means. – CommonsWare Apr 20 '12 at 13:31