Hide an application from Android application list

前端 未结 3 1576
Happy的楠姐
Happy的楠姐 2021-02-14 17:14

Is there any way to hide an application icon from Android applications list ? The application should be downloaded from Market and opened some GUI for configuring my application

3条回答
  •  花落未央
    2021-02-14 17:57

    I have found a way for this to work when you reinstall the app.

    Add a broadcast receiver with intent filter action android.intent.action.PACKAGE_ADDED.

    In the onReceived method you must activate your disabled component :

    ComponentName componentToEnable = new ComponentName(context, Your_disabled_class.class);
    PackageManager pm = context.getPackageManager();
    pm.setComponentEnabledSetting(componentToEnable, PackageManager.COMPONENT_ENABLED_STATE_ENABLED,                           PackageManager.DONT_KILL_APP);
    

    Complete AndroidManifest.xml for receiver:

    
    
    
    
    
    
    
    
    
    
    
    

提交回复
热议问题