“Avoid passing null as the view root” warning when inflating view for use by AlertDialog

前端 未结 10 746
面向向阳花
面向向阳花 2020-12-12 15:41

I get the lint warning, Avoid passing null as the view root when inflating views with null as parent, like:

LayoutInfl         


        
10条回答
  •  我在风中等你
    2020-12-12 16:45

    You don't need to specify a parent for a dialog.

    Suppress this using @SuppressLint("InflateParams") at the top of the override.

提交回复
热议问题