Android4.1 屏蔽一些不用的apk桌面显示

一:packages\apps\Launcher2\src\com\android\launcher2\AllAppsList.java:

/* Hide Package List */
    public final String mHidePackage[] = 
        {
            "com.android.quicksearchbox",
            "com.android.contacts",//不想要显示联系人和拨号程序
            "com.google.android.gsf.login.AccountIntroUIActivity ",
            "com.android.contacts.activities.PeopleActivity",
            "com.google.android.gsf.login.AccountIntroActivity"
};


 public void add(ApplicationInfo info) {
        if (findActivity(data, info.componentName)) {
            return;
        }
         // add by cao
        if (activityFilter(info)){
            return;
        }

----------------------------------------------------------------------------------------------

}

    // add by cao
    private boolean activityFilter(ApplicationInfo info){
        for(int i=0;i<mHidePackage.length;i++){
            if(info.componentName.getPackageName().compareTo(mHidePackage[i]) == 0){
                return true;
            }
if(info.componentName.getClassName().compareTo(mHidePackage[i]) == 0)
{
return true;
}
        }
        return false;
    } // end 

或者直接找到AndroidManifest.xml注释掉:

<category android:name="android.intent.category.LAUNCHER" />

你可能感兴趣的:(Android4.1 屏蔽一些不用的apk桌面显示)