Avoid passing null as the view root当使用nullas 扩大视图时,我会收到棉绒警告parent,例如:
LayoutInflater.from(context).inflate(R.layout.dialog_edit, null);
但是,该视图将用作on 的内容AlertDialog,使用setViewon AlertDialog.Builder,所以我不知道应将什么作为the传递parent。
您认为parent在这种情况下应该怎么办?
null。
null。您可以抑制皮棉是有原因的。Lint应该为您经常遇到的问题提供警告;在这种情况下,它是正确的调用。