原因:
原因其实很简单,虽然主题对象进行了深度复制,但是没有让主题资源应用到主题中,让我们看看Android源码就知道了:
@Override public void setTheme(int resid) {
mThemeResource = resid;
initializeTheme();
}之后看看怎么设置主题的
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
theme.applyStyle(resid, true);
}
private void initializeTheme() {
final boolean first = mTheme == null;
if (first) {
mTheme = getResources().newTheme();
Resources.Theme theme = mBase.getTheme();
if (theme != null) {
mTheme.setTo(theme);
}
}
onApplyThemeResource(mTheme, mThemeResource, first);
}解决方案:
既然源码写的这么清晰明了,那么我们就依葫芦画瓢就OK 了
https://github.com/singwhatiwanna/dynamic-load-apk/compare/master...1liufeilong:patch-1
我已经提交到github上了,希望对大家有用,早日解决三星问题。
本文详细解析了Android源码中关于主题应用的过程,并提供了解决三星设备主题应用问题的具体方法,通过依葫芦画瓢的方式解决该问题。

被折叠的 条评论
为什么被折叠?



