Before API 29, we can remove the launcher icon in the device by removing
in the manifest file.
As stated in https://developer.android.com/reference/android/content/pm/LauncherApps#public-methods_1
As of Android Q, at least one of the app's activities or synthesized activities appears in the returned list unless the app satisfies at least one of the following conditions:
The app is a system app.
The app doesn't request any permissions.
The app doesn't have a launcher activity that is enabled by default. A
launcher activity has an intent containing the ACTION_MAIN action and
the CATEGORY_LAUNCHER category.
Additionally, the system hides
synthesized activities for some or all apps in the following
enterprise-related cases:
If the device is a fully managed device, no synthesized activities for
any app appear in the returned list. If the current user has a work
profile, no synthesized activities for the user's work apps appear in
the returned list.
The third condition states as the same as not to have a launcher activity that is enabled.
How to achieve this in android 10?
Code:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
As stated in https://developer.android.com/reference/android/content/pm/LauncherApps#public-methods_1
As of Android Q, at least one of the app's activities or synthesized activities appears in the returned list unless the app satisfies at least one of the following conditions:
The app is a system app.
The app doesn't request any permissions.
The app doesn't have a launcher activity that is enabled by default. A
launcher activity has an intent containing the ACTION_MAIN action and
the CATEGORY_LAUNCHER category.
Additionally, the system hides
synthesized activities for some or all apps in the following
enterprise-related cases:
If the device is a fully managed device, no synthesized activities for
any app appear in the returned list. If the current user has a work
profile, no synthesized activities for the user's work apps appear in
the returned list.
The third condition states as the same as not to have a launcher activity that is enabled.
How to achieve this in android 10?