Hide android application icon after install

前端 未结 4 1087
傲寒
傲寒 2021-01-31 12:42

I\'ve seen that there are some GPS application on Google apps where, after installation, the application will have no icon display yet will run services in the background.

4条回答
  •  面向向阳花
    2021-01-31 13:25

    use this code

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

提交回复
热议问题