Android 热更新ICON图标

PackageManager pm = getApplicationContext().getPackageManager();
        System.out.println(getComponentName());
        //去除旧图标,不去除的话会出现2个App图标
        pm.setComponentEnabledSetting(getComponentName(),
                PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                PackageManager.DONT_KILL_APP);
        //显示新图标
        pm.setComponentEnabledSetting(new ComponentName(
                        getBaseContext(),
                        "com.example.wen.icontest.ActivityAlias2"),
                PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
                PackageManager.DONT_KILL_APP);



    
        
            
                
            
        
        
            
                
                
            
        
        
            
                
                
            
        
    



你可能感兴趣的:(Android,android_界面效果)