If you use:
LayoutInflator.inflate(resource, parent)
instead of LayoutInflator.inflate(resource, parent, false)
you will most likely run into problems at runtime.
I'd like to see a lint warning for this or understand why this may not be a problem in all cases.
答案 0 :(得分:1)
I'd like to see a lint warning for this
This is not an issue tracker.
why this may not be a problem in all cases
The two-parameter inflate()
is fine if your objective is to add the inflated layout as a tree of children to the designated parent. In some cases, this is what you want. In other cases, it is not. I will readily agree that for most developers and most use cases, the three-parameter-with-false
inflate()
is the right answer (e.g., ListAdapter
, RecyclerView.Adapter
).