Can I set dynamically within an activity the preferred/default application that’s to be launched when I push the Home key? If that’s not possible, can I at least reset current defaults so that the chooser window re-appears? I tried to implement the latter by calling PackageManager.clearPackagePreferredActivities(“com.android.launcher”), but that doesn’t seem to do it(I gave my activity SET_PREFERRED_APPLICATIONS permission).
Can I set dynamically within an activity the preferred/default application that’s to be launched
Share
No. There is no exposed API for this.
Only if you are implementing the home screen that is the current default.
As the documentation for that method states, “An application can only clear its own package(s).”.