TypedArray a = mContext.obtainStyledAttributes(attrs); boolean hasBottomLine = a.getBoolean(0, false); boolean hasTopLine = a.getBoolean(1, false);//AS會在"1"下顯示錯誤紅線.
在該方法上添加@SuppressWarnings("ResourceType"),這樣便可過濾該警告,能夠正常經過簽名編譯。typescript
@SuppressWarnings("ResourceType")