“main cannot be resolved or is not a field”解决方案
.layout.main总是在layout上有错误提示波浪线。
解决方法:
(1) 删除"import android.R;".
(2) 勾选上Eclipse中的"Project->Build
Automatically";
原因是:
添加文件,比如xml文件或者资源文件时,系统自动添加了import
android.R;android.R是系统提供的资源,R是应用程序的资源。删除"import
android.R"之后工程就是从/res文件夹下自动生成的资源文件里去解析了,否则它会从Android的资源类里去找。
“main cannot be resolved or is not a field”解决方案的更多相关文章
- main cannot be resolved or is not a field
今天在做XML解析的时候,总是给我报 XML Parsing Error: XML or text declaration not at start of entity 的错误,后来查了下讲大概意思是 ...
- layout cannot be resolved or is not a field
去除代码activity代码页面顶部中的 import android.R;这句就可以消除红色波浪线的main cannot be resolved or is not a field类似这个错误了
- Andrion错误解决:cannot be resolved or is not a field
cannot be resolved or is not a field 解决这个问题: 选择project菜单中的clean,选择你的项目,先clean一下, 再去看看Activity中有没 ...
- "cannot be resolved or is not a field"问题解决 (转载)
转自:http://blog.csdn.net/liranke/article/details/16803295 在修改了资源文件后,出现“"cannot be resolved or is ...
- R.layout.main cannot be resolved解决办法
今天敲的代码 package com.sharpandroid.activity; import android.R; import android.app.Activity; import andr ...
- R.layout.main connot be resolved 和R.java消失
出现例如以下问题: 鼠标放到出代码上面: 分析问题: 1.查看R文件是否被生成.假设没有生成,则勾选build Automatically,然后Clean: 2.假设R文件已生成.则删除去掉代码中: ...
- 出现 cannot be resolved or is not a field 错误
删除R.Java文件,这时,系统会重新生成一个R.java; 删除java代码中的"import Android.R"文件. 重新导入正确的包.
- R.id.layout等不能识别:cannot be resolved or is not a field
Do not modify the R class. The error means there's something syntactically wrong with your XML layou ...
- Android错误之--activity_main cannot be resolved or is not a field
一般在copy别人的项目中会easy出现本错误,截图例如以下:
随机推荐
- FTP操作类(支持异步)
public delegate void DownloadProgressChangedEventHandle(string information, long currentprogress, lo ...
- Sublime text 取消记住上一次打开的,这功能太墨迹了!
比较恨,这sublime text的配置全部都是配置文件. 选择菜单:Preferences->Settings-User,增加配置项 //热退出,其实实现一种模拟没有退出的状态,当程序再次启动 ...
- c++ 枚举 在函数中的应用
#include <iostream> using namespace std; enum RespErrNo { SUCCESS = , INVALID_URL = , INVALID_ ...
- 【POJ】【1061】/【BZOJ】【1477】青蛙的约会
扩展欧几里德 根据题意列出不定方程: (x+m*T)-(y+n*T)=k*L; //T表示跳了T次,由于是环,可能追了多圈,所以结果应为k*L 化简得 T(m-n)-kL=y-x; 这就成了我们熟悉 ...
- [CFgym]2015-2016 ACM-ICPC Pacific Northwest Regional Contest小结
*感谢两位浙江大佬带我飞 贴下成绩 div2 div1 *div2不是我打的上个厕所就5/11了 比赛小结 A [题目大意] 有n(n<=500)个机场,两两之间距离是g[i][j],每经停一个 ...
- windows下创建.htaccess文件之讲解
如果想在Windows操作系统下新增一个.htaccess 文件实现对页面的rewrite,任你如何右点鼠标或者选文件->新增去新增都不会成功的,Windows都会要求给个文件名称.如果你想通过 ...
- Iptables DDOS/CC 自动屏蔽脚本
Iptables DDOS/CC 自动屏蔽脚本 May 20, 2013 最近不停地被 CC (DDOS的一种)频繁干扰,分享一个 iptables 屏蔽 DDOS 的脚本.让 crond 每分钟运行 ...
- C#中dynamic的正确用法 以及 typeof(DynamicSample).GetMethod("Add");
dynamic是FrameWork4.0的新特性.dynamic的出现让C#具有了弱语言类型的特性.编译器在编译的时候不再对类型进行检查,编译期默认dynamic对象支持你想要的任何特性.比如,即使你 ...
- JAVA多线程的问题以及处理【转】
http://www.cnblogs.com/springcsc/archive/2009/12/03/1616394.html 12.4 多线程问题及处理 多线程编程为程序开发带来 ...
- JVM基础学习
public class TestJVM { // 运行时数据区[方法区.堆.程序计数器.虚拟机栈.本地方法栈] private static int _1M = 1024 * 1024; publi ...