String[] forbiddenPackages = new String[] { "com.ximalaya.ting.android", "fm.qingting.qtradio", "com.tencent.qqmusiccar" }; if (Arrays.asList(forbiddenPackages).contains(p.packageName)) { continue; }