问题
Possible Duplicate:
Android: change default Home Application
I want to create a program like "Home Switcher" that can programmatically set the default launcher. I have no code written yet but can kind of figure out how to find the available launcher apps, but I have no idea how to programmatically set the default. Can anyone point me in the right direction?
回答1:
This is not possible, except perhaps via some security flaw. I will look into it and try to get this flaw fixed, assuming that this app actually works.
Rooted devices should be able to do this, but not unrooted ones.
UPDATE
These apps do not actually set the default home, near as I can tell. They are simply calling startActivity()
with a MAIN
/LAUNCHER
Intent
, using createChooser()
to force a chooser dialog to appear, giving the user the opportunity to choose a home screen and make it the default. This is perfectly legitimate, as it requires user involvement in the process.
Leastways, three of them work this way, while one simply crashes when trying to set a home screen.
来源:https://stackoverflow.com/questions/12865367/how-do-i-programmatically-set-the-default-launcher-app