So I have one app that displays multiple activities in the Launcher using
<category android:name="android.intent.category.LAUNCHER"/>
I want to know how to programmatically toggle this on/off, I will be needing to do so based on some data I will be receiving. Is this possible? If so, how can it be done.
You can call setComponentEnabledSetting()
on PackageManager
to enable and disable the activity. Well-written home screen implementations will remove the launcher icon when you disable the activity with the LAUNCHER
category.
However, bear in mind that some home screen implementations will cache the information that they obtain from PackageManager
and therefore may continue to show the icon, until they refresh their contents. There is nothing much that you can do about this.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments