setContentView()在我的R.layout文件夹中看不到所有布局

问题描述 投票:0回答:1

在我的一种方法中,我想将布局切换为辅助布局。但是由于某种原因,setContentView在文件夹中看不到布局。下图显示了这一点:

My layout folder

The image that appeared after I clicked the "Create layout named..." suggestion

然后运行代码

setContentView(R.layout.saveg_w_name) //I know this name is correctly spelled and everything since I clicked the createLayout

但是它仍然给出无法解析的符号错误。这是Android Studio的错误还是我做错了?

android
1个回答
0
投票

只需重新启动您的android studio,然后再次检查。

如果仍然不能解决您的问题,请尝试使缓存无效。

单击文件(菜单)->使缓存无效/重新启动

© www.soinside.com 2019 - 2024. All rights reserved.