How do I undo clearPackagePreferredActivities("com.android.launcher");
<p>What I am trying to do is replicate what the ToddlerLock app does.  I have managed to clear the default launcher with </p>

<pre><code>PackageManager localPackageManager = getPackageManager();
localPackageManager.clearPackagePreferredActivities("com.android.launcher");
</code></pre>

<p>and then open the launch select dialog with this</p>

<pre><code>Intent i = new Intent();
i.setAction(Intent.ACTION_MAIN);
i.addCategory(Intent.CATEGORY_HOME);
this.startActivity(i); 
</code></pre>

<p>As long as the user checks the "use by default for this action" the home key now sends the user to my app, thus essentially disabling it.<br>
I then use "clearPackagePreferredActivities("com.my_application")" when I exit my app and the user has to choose a new default home app.</p>

<p>My question is how can I choose the default home application (essentially checking the "use by default for this action" check box in code for the "com.android.launcher" package. That way the user does not constantly have to see that dialog box every time they open and close my app. </p>

<p>I think ToddlerLock does this somehow without using clearPackagePreferredActivities
because if I look at the "clear defaults" in the application manager it is not cleared and you only have to go through the set as default dialog box one time on startup and once when you exit to set it back to the normal home screen. </p>

<p>Thanks for your help.</p>
