Hide application icon

前端 未结 5 1789
广开言路
广开言路 2020-12-01 02:58

I am doing an Android application. I want to hide the application icon in the emulator and I want to start my application by pressing some numbers, for instance 456#. Is the

5条回答
  •  爱一瞬间的悲伤
    2020-12-01 03:52

    Note that the solution:

    PackageManager pm = getApplicationContext().getPackageManager(); 
    pm.setComponentEnabledSetting(getComponentName(), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
    

    will make the app NOT upgradeable from google play as the OS will not find the package after this component disabling and will not able to re-install it, unless the app is not manullay uninstalled (which is not a user friendly behaviour)

提交回复
热议问题