use*_*266 2 layout android layout-inflater
所以我试图在我的活动中膨胀布局,但我不断收到此错误"无法解决方法inflate(int)"
LayoutInflater layoutInflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View error = layoutInflater.inflate(R.layout.error_internet_connection);
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
没有方法inflate(int).可用的方法是inflate(int, ViewGroup)和inflate(int, ViewGroup, boolean).
更改
View error = layoutInflater.inflate(R.layout.error_internet_connection);
Run Code Online (Sandbox Code Playgroud)
至
View error = layoutInflater.inflate(R.layout.error_internet_connection, null);
Run Code Online (Sandbox Code Playgroud)
在这里您可以找到文档
| 归档时间: |
|
| 查看次数: |
5700 次 |
| 最近记录: |