在作一個應用時把Android SDK從4.4換成6.0,使用LayoutInflater的inflate方法時出現如下情html
LayoutInflater.inflate(int resource, ViewGroup root)
參數root爲null時,出現warning提示java
Avoid passing null as the view root (needed to resolve layout parameters on the inflated layout's root element)spa
建議添加3d
@SuppressLint("InflateParams")
在網上查了,若是改用View的inflate方法root爲null就不會出現warning提示code
View.inflate(Context context, int resource, ViewGroup root)