Is there a way to set a default home/launcher programatically on Android?
-
28-10-2019 - |
سؤال
I've created my own home/launcher and would like to set it as default depending on my location, but as far as I'm aware you can only clear/set defaults for home in the 'settings->applications->manage applications->name of home/launcher' : is this possible? I'm guessing it's not as it kind of takes control away from the user but I thought I would check...
المحلول
It is not possible to set a default HOME application from code, if you could do it it would be a security issue.
نصائح أخرى
Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(startMain);
We analyse an app named Launcher Switcher, it seems run ok in Android 2.2. Click a button to set the default launcher. But I installed it in Android 4.0, it's not work. After set the default launcher, when click the HOME button, the launcher choice window is still opens.
referenced from this: Set default Home app dynamically