burgessjp/ThemeSkinning

style内的drawable为对drawable的引用时在4.几的机子上会报错崩溃

Closed this issue · 4 comments

@drawable/selector_item
在style内的background为针对drawable资源的引用时,SkinInflaterFactory.parseSkinAttr的TypedArray.getColor()在4.几的机子上会抛出错误,6.0的机子没问题,5.0的没试过
Caused by: android.content.res.Resources$NotFoundException: android.content.res.Resources.loadColorStateList(Resources.java:2088)
android.content.res.TypedArray.getColor(TypedArray.java:326)
solid.ren.skinlibrary.loader.SkinInflaterFactory.parseSkinAttr(SkinInflaterFactory.java:93)

PS:所有引用资源写成@null时,getResourceEntryName()方法也会抛出异常导致崩溃

我这4,5,6,都试过没问题,请问下你手机是哪个机型的。关于@null的这个问题,之前还真没注意,感谢提醒。

现在@null的问题已经修复了

LD-D802 4.2.2
我就是改动了你代码里ItemTitleText的style下的background属性,指向为@drawable/selector_item
错误为:
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/selector_item.xml from color state list resource ID #0x7f020076
at android.content.res.Resources.loadColorStateList(Resources.java:2127)
at android.content.res.TypedArray.getColor(TypedArray.java:319)
at solid.ren.skinlibrary.loader.SkinInflaterFactory.parseSkinAttr(SkinInflaterFactory.java:92)
at solid.ren.skinlibrary.loader.SkinInflaterFactory.onCreateView(SkinInflaterFactory.java:66)
at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:47)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:675)
... 73 more
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #3: tag requires a 'android:color' attribute.
at android.content.res.ColorStateList.inflate(ColorStateList.java:226)
at android.content.res.ColorStateList.createFromXmlInner(ColorStateList.java:150)
at android.content.res.ColorStateList.createFromXml(ColorStateList.java:129)
at android.content.res.Resources.loadColorStateList(Resources.java:2124)
... 78 more

我检查了下,这个问题确实存在,与机型无关。现在已经修复了