我是靠谱客的博主 可爱汽车,这篇文章主要介绍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中调用inflate时出现的警告错误处理的全部内容,更多相关android中调用inflate时出现内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(109)

评论列表共有 0 条评论

立即
投稿
返回
顶部