You can neither enable, disable, or create <intent-filter>
s programmatically.
However, in your case, you only have one <intent-filter>
per component. In that case, you can enable and disable the component programmatically, via PackageManager
and setComponentEnabledSetting()
. In your case, enabling or disabling the activity would have the same basic effect as enabling or disabling its <intent-filter>
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…