Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

programmatically unset a default application

Tags:

android

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 ?

like image 873
Denys Séguret Avatar asked May 13 '10 15:05

Denys Séguret


1 Answers

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()?

like image 91
satur9nine Avatar answered Oct 21 '22 20:10

satur9nine