hide app icon in android 10

dear users!
i want to hide app icon in android 10.
This code works fine until Android 9.
ComponentName componentToDisable = new ComponentName(
this,
com.android.test.MainActivity.class);

getPackageManager().setComponentEnabledSetting(
componentToDisable,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP
);

Intent MainIntent = new Intent(Intent.ACTION_MAIN, null);
MainIntent.addCategory(Intent.CATEGORY_LAUNCHER);

i want source code for it

We are happy you are here! You are more likely to get a useful response if you are explicit about what your project entails, giving a few more details might help someone give you a nudge in the right directions.

Did you find any thing for hiding icon ?