view v = LayoutInflater.from(this).inflate(R.layout.activity_main, null);
出现警告:void passing null as the view root (needed to resolve layout parameters on the inflated layout's root element)
这时需要使用如下代码来代替
LayoutInflater.from(this).inflate(R.layout.activity_main, parent, false);