Avoid passing null as the view root (need to resolve layout parameters on the inflated layout's root element)

前端 未结 7 663
旧时难觅i
旧时难觅i 2020-11-27 10:13

Passing null for root studio gives me this warning:

Avoid passing null as the view root (need to resolve layout parameters on the inflated layout\'s r

相关标签:
7条回答
  • 2020-11-27 10:40

    A nice information I found while looking for a way to solve this.According to Dave Smith,

    Layout inflation is the term used within the context of Android to indicate when an XML layout resource is parsed and converted into a hierarchy of View objects.

    The ViewGroup been asked for here as part of the inflate method parameters is used to inherit higher level styling.While passing null can seem harmless, it can actually cause serious problems for your app later on. Read more about this here.

    0 讨论(0)
提交回复
热议问题