Android home-screen/launcher chooser does not show 'use by default for this action' option
android, homescreen
Solution
`createChooser()` does not produce a "default for this action" checkbox. If you'd like the checkbox, instead pass an intent to `startActivityForResult()`
Problem
I am trying to launch the Home-screen/Launcher chooser dialog programmatically by using the following intent: ``` Intent i = new Intent(Intent.ACTION_MAIN); i.addCategory(Intent.CATEGORY_HOME); i.addCategory(Intent.CATEGORY_DEFAULT); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(Intent.createChooser(i, "Set My HomeScreen as default")); ``` But unfortunately the dialog that appears with the list of installed home-screen launchers does not have the Use by default for this action option at the bottom of the dialog. The following image shows how it looks: Interestingly after choosing my home-screen from the above chooser dialog, if I press home button from my that screen then Android automatically shows up a similar dialog which in fact has the Use by default for this option at the bottom of the dialog. Here is how it looks: I am pretty clueless about what's wrong with the above code, it must be some silly mistake that I am not able to spot myself. if anyone of can shed some light, then it would be of great help. Thanks