Wow! Thank you so much, Mark. You really guided me to the right place.
Here is what I come up with:

In the manifest, I have my Activity, let's call it
com.test.disable.TargetActivity, and it is set with one or more intent
filters.

So, during the app execution, somewhere in the code, I can see if the
conditions for the Activity are met, so that it can be launched, and
if the conditions don't met:

        PackageManager pm =
getApplicationContext().getPackageManager();
        pm.setComponentEnabledSetting(
                new ComponentName("com.test.disable",
TargetActivity.class.getName()),
                PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                PackageManager.DONT_KILL_APP);

This disables the Activity, and thus, the intent filters. The Activity
is disabled forever, even after a reboot, and can only be activated on
reinstalling the app or by running the same code with the flag
COMPONENT_ENABLED_STATE_ENABLED.

Well, at least it works on the emulator. It's past midnight in here,
so I'll test this on a bunch of devices tomorrow at work.

Thank you again, Mark.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to