When making an application, the Android SDK is changed from 4.4 to 6.0. When using the inflate method of layoutinflater, the following situation appears
LayoutInflater.inflate(intresource,ViewGrouproot)
When the parameter root is null, a warning message appears
Avoid passing null as the view root (needed to resolve layout parameters on the inflated layout’s root element)
You should add:
@SuppressLint("InflateParams")
If you use the inflate method of view and root is null, the warning prompt will not appear
View.inflate(Contextcontext,intresource,ViewGrouproot)
Similar Posts:
- Elimination of warning message “nested weights are bad for performance”
- [Solved] Android studio preview view Error: java.lang.NoSuchMethodError
- [Solved] android.view.InflateException: Binary XML file line #0: Error inflating class ImageView
- How to Solve Issue: ScrollView can host only one direct child
- [Solved] Java.lang.IllegalStateException: Circular dependencies cannot exist in RelativeLayout
- [How to Solve] log4j: WARN Please initialize the log4j system properly
- How to fix error messages related to sap ui5 aggregation with cardinality 0.. 1
- Android Your content must have a ListView whose…
- [Solved] Android Warning: Cannot call this method while RecyclerView is computing a layout or scrolling