原因:TypedArray ta = obtainStyledAttributes(R.style.MyCustomStyle, attrs)
解決:(在它的函數上添加)
@SuppressWarnings("ResourceType")
三、Android xxx is not translated in zh
原因:在默認的strings.xml中有值,但是在values-zh文件夾下的srings.xml中沒有值導致
Lint的終極解決辦法:
在主項目的builde.gralde裏添加如下代碼
android {
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to checkforerrorsinrelease builds,
// but continue the build even whenerrorsarefound:
abortOnError false
}
}