的setContentView参数示值误差 [英] SetContentView parameter is showing error
本文介绍了的setContentView参数示值误差的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想这样的:
setContentView(R.layout.activity_main);
主要是我的的main.xml
在我的菜单文件夹,但它显示我的错误在 activity_main
main is my main.xml
in my menu folder , but its showing me error in activity_main
错误
活动没有得到解决,或者不是一个字段
同为
mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.opencv_part_java_surface_view);
和
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
上面显示在 R.menu.main
推荐答案
可能您已经导入<$ C $ C> android.R.java 其中,它应该是 yourpackage.R.java
。
May be you have imported android.R.java
where it should be yourpackage.R.java
.
如果你这样做,然后删除进口android.R
,然后清理并生成项目。
If you did that then delete the import android.R
and then clean and build your project.
这篇关于的setContentView参数示值误差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文