1. Change to your own launcher
ComponentName component = new ComponentName (
Context.getpackagename (), MainActivity.class.getName ());//red for own launcher entrance
componentname[] Components = new componentname[] {
New ComponentName ("Com.android.launcher",
"Com.android.launcher2.Launcher"), component};
Pm.clearpackagepreferredactivities ("Com.android.launcher");//clear Default Launcher
Pm.addpreferredactivity (filter, Intentfilter.match_category_empty,
components, component);
2, change the system launcher
ComponentName component = new ComponentName ("Com.android.launcher",
"Com.android.launcher2.Launcher");
componentname[] Components = new componentname[] {
New ComponentName (Context.getpackagename (), MainActivity.class.getName ()), component};
Pm.clearpackagepreferredactivities ("Com.android.launcher");
Pm.addpreferredactivity (filter, Intentfilter.match_category_empty,
components, component);
3. References
http://blog.csdn.net/wh_19910525/article/details/39025425
http://blog.csdn.net/lwyygydx/article/details/42873829
Http://www.07net01.com/2014/09/79947.html
http://blog.csdn.net/jia4525036/article/details/18036765
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Modify the app's default settings (including modifying the default launcher)