Android Question Hide and show my app icon in Android 10

Neojoy

Member
Licensed User
Longtime User
Hi,

The code that I was using to hide and show icon doesn't work anymore in Android 10.

I read in Reddit that is no longer possible.

Is there a solution for this?

My code:

B4X:
'show
JavaObject1.RunMethod("setComponentEnabledSetting", Array As Object(MAIN_ACTIVITY_FULLY_QUALIFIED_NAME, ENABLED_STATE_ENABLED))

'hide
JavaObject1.RunMethod("setComponentEnabledSetting", Array As Object(MAIN_ACTIVITY_FULLY_QUALIFIED_NAME, ENABLED_STATE_DISABLED))

#If JAVA
public void setComponentEnabledSetting(String fullyQualifiedClassName, int enabledState){
    ComponentName componentName = new ComponentName(this, fullyQualifiedClassName);
    this.getPackageManager().setComponentEnabledSetting(componentName, enabledState, PackageManager.DONT_KILL_APP);
}
#End if

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
Last edited:
Upvote 0
Top