I have an application with the following lines in the AndroidManifest:
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
My question is: is it possible to set these options programmatically? I mean, some users will be able to enable or disable the options above.
What this does is to keep my app as a launcher.
So, is it possible to put a condition on this, so I can make it depending on the user?
EDITION: I edited this question to add the suggestion of Rawr.
Here is what I am doing before calling my main activity:
Intent myIntent = new Intent(v.getContext(), MainActivity.class);
myIntent.addCategory(Intent.CATEGORY_HOME);
myIntent.addCategory(Intent.CATEGORY_DEFAULT);
myIntent.addCategory(Intent.CATEGORY_MONKEY);
startActivity(myIntent);
If I use these commands inside my manifest, they work. One cannot leave my app by pressing home button. Adding categories manually like above doesn't work.
Any suggestions?
Thank you in advance!