8

I made a Home application and I'd like to offer the ability to exit it and unset it as the default application.

Exit is easy (just starting an intent) but the problem is I don't want my program to be launched again the next time the user click the Home button.

I know that this can be done by going in the parameters / Applications / my app / erase default actions but I would like to do it from my program so that the user doesn't have to search this function.

How can it be done ?

Denys Séguret
  • 372,613
  • 87
  • 782
  • 758

1 Answers1

6

You can use the PackageManager to clear yourself from being the default activity, you cannot clear other activities. This answer may help: How do I use PackageManager.addPreferredActivity()?

Community
  • 1
  • 1
satur9nine
  • 13,927
  • 5
  • 80
  • 123