In my activity I have a web view and in manifest.xml I have declared intent filter like this
This i achieved but faced issues when upgraded my app to Marshmallow support.
Dynamically you can't remove the IntentFilter from the Manifest Components.
If you are working on Marmalade/Native languages like C & C++(NDK), You can achieve disable the IntentFilter components but after platform upgrade(like Kitkat to LollyPop) it gives problem.
This changes is not recommended by android community in any of the developer.android.com pages.
One Solution could be,
String packageName = getPackageName();
try {
PackageInfo p = getApplicationContext().getPackageManager().getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
for (ActivityInfo activityInfo : p.activities) {
if(log.d()) log.d("ACT " + activityInfo.name+" "+activityInfo.packageName);
}
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
Go with alias from the code "alias"
ComponentName componentWithoutTextFiles = new ComponentName(packageName, packageName".alias");