android中调用inflate时出现的警告错误处理


view v = LayoutInflater.from(this).inflate(R.layout.activity_mainnull);

出现警告:

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);

你可能感兴趣的:(android)