diff --git a/app/src/main/java/io/github/chipppppppppp/lime/Main.java b/app/src/main/java/io/github/chipppppppppp/lime/Main.java index 6993ed1f..3a73db3a 100644 --- a/app/src/main/java/io/github/chipppppppppp/lime/Main.java +++ b/app/src/main/java/io/github/chipppppppppp/lime/Main.java @@ -148,11 +148,12 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable { if (deleteRecommendation) { hookTarget = lparam.classLoader.loadClass("android.widget.LinearLayout"); XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() { + int recommendationResId = -1; @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { View view = (View) param.thisObject; Context context = view.getContext(); - int recommendationResId = context.getResources().getIdentifier("home_tab_contents_recommendation_placement", "id", context.getPackageName()); + if (recommendationResId == -1) recommendationResId = context.getResources().getIdentifier("home_tab_contents_recommendation_placement", "id", context.getPackageName()); if (view.getId() == recommendationResId) view.setVisibility(View.GONE); } });