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).
+2
A:
Can I set dynamically within an activity the preferred/default application that's to be launched when I push the Home key?
No. There is no exposed API for this.
If that's not possible, can I at least reset current defaults so that the chooser window re-appears?
Only if you are implementing the home screen that is the current default.
I tried to implement the latter by calling PackageManager.clearPackagePreferredActivities("com.android.launcher")
As the documentation for that method states, "An application can only clear its own package(s).".
CommonsWare
2010-10-20 18:22:46