Eddie J
04/02/2022, 4:18 PMContextWrapper
to wrap the Resources for mostly the string.
My codes on that are like:
// BaseActivity.java
@Override
protected void attachBaseContext(Context newBase) {
// ResourcesContextWrapper extends from ContextWrapper
resourcesContextWrapper = ResourcesContextWrapper.wrap(newBase);
super.attachBaseContext(resourcesContextWrapper);
}
...
...
...
// In ResourcesContextWrapper.java
private ResourcesWrapper resourcesWrapper;
@Override
public Resources getResources() {
return resourcesWrapper == null ? super.getResources() : resourcesWrapper;
}
By this code above, when I call:
getContext().getResources()
it will return me ResourcesWrapper
Without Chucker or with Chucker-No-op, the wrapper works fine. Calling getResources()
returns me ResourcesWrapper
which is what I need but with Chucker, it keep returning me the default system Resources instead.
I’ve tried couple times and still get the same result so I just want to know if it really is unrelated 😅 or somebody has faced this before.
Apart from what I mentioned above, every Chucker’s features work fine.
Please suggest 🙏radityagumay
04/03/2022, 11:18 PMradityagumay
04/03/2022, 11:19 PMEddie J
04/04/2022, 7:36 AMgammax
04/04/2022, 11:11 AM