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 layouts and R cannot be auto-generated. Try looking there and post the xml code you're not sure about, if any.
Edit : also: remove "import android.R" from imports at top of file (if there)
我的解决方案是去掉了import android.R这一行,增加了现有的包名import com.example.avtivitytest.R;
//import android.R;
import com.example.avtivitytest.R;
R.id.layout等不能识别:cannot be resolved or is not a field的更多相关文章
- findViewById(R.id.btn_first) 给写成 R.layout.
窗体内放了个按钮, findViewById(R.id.btn_first) 给写成 R.layout. 在java 里边引用结果就是找不到那个id 找了半天找不到原因, 奔着网上常见R找不到的问题, ...
- Andriod学习笔记2:“Your content must have a ListView whose id attribute is 'android.R.id.list'”问题的解决办法
问题描述 activity_main.xml代码如下: <?xml version="1.0" encoding="utf-8"?> <Lin ...
- 初学时遇到的小问题Your content must have a ListView whose id attribute is 'android.R.id.list'
问题提出 错误提示:Your content must have a ListView whose id attribute is 'android.R.id.list' 关于解决Your conte ...
- Android java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or its superclasses
项目开发快到尾声,突然发现之前一个模块莫名其妙的奔溃了,我的内心也是奔溃的.以前一直都是好好的,也没去动过它,为啥会出现这样的问题呢? 下面我会根据自己的理解来看待问题 android是怎么根据id查 ...
- Android 找不到所标识的资源 java.lang.NoSuchFieldError: No static field XXX of type I in class Lcom/XX/R$id
报错: java.lang.NoSuchFieldError: No static field XXX of type I in class Lcom/XXX/R$id; or its supercl ...
- java.lang.NoSuchFieldError: No static field XXX of type I in class Lcom/XX/R$id; or its superclasses
报错: 当启动一个页面的时候报错: java.lang.NoSuchFieldError: No static field XXX of type I in class Lcom/XXX/R$id; ...
- .replace(R.id.container, new User()).commit();/The method replace(int, Fragment) in the type FragmentTransaction is not app
提示错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the arg ...
- Android Your content must have a ListView whose id attribute is 'android.R.id.list'错误的解决办法
在Android开发中,ListView有着很重要的地位,使用的场合也非常的多 错误提示:Your content must have a ListView whose id attribute is ...
- Library Project里面使用Case语句判断R.id值报错。case expressions must be constant expressions
原文地址:http://blog.csdn.net/wchinaw/article/details/7325641 在一般的Android项目里R里面的资源声明看起来是这样的: public stat ...
随机推荐
- hdu 4046 Panda 树状数组
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4046 When I wrote down this letter, you may have been ...
- [haoi2009]毛毛虫 树形dp
这道题细节处理不少,但要AC不难: 设以i节点为根节点的子树能形成的最大的毛毛虫长度为f[i],则f[i]=max(f[j])+i节点的孩子数: 答案需要f最大和次大的两个子树合并,而且若合并的位置不 ...
- JS模板引擎 :ArtTemplate (2)
上一篇初略的介绍了一下javascript中的模板引擎,有兴趣的可以戳 这里 . 这一篇将带着大家一起做一个简易的模板引擎, 上一篇介绍到:模板引擎其实做的就是两件事. 根据一定的规则,解析我们所定义 ...
- CSS3弹性盒模型,Flex布局教程
布局的传统解决方案,基于盒状模型,依赖 display属性 + position属性 + float属性.它对于那些特殊布局非常不方便,比如,垂直居中就不容易实现. CSS3中引入flex的弹性盒模型 ...
- Css选择器的优先级
a = 行内样式style. b = ID选择器的数量. c = 类.伪类和属性选择器的数量. d = 类型选择器和伪元素选择器的数量. 选择器 等级(a,b,c,d) style=”” 1,0,0, ...
- codeforces 425B Sereja and Table(状态压缩,也可以数组模拟)
题目 给出一个n*m的01矩阵, 让你最多改变k个里面的值(0变1,1变0), 使得0.1的连通分量是矩阵.输出最少步数 1 ≤ n, m ≤ 100; 1 ≤ k ≤ 10 题解: 如果01连通分量 ...
- 几点基于Web日志的Webshell检测思路
http://www.open-open.com/lib/view/open1456751673359.html
- Jquery+Ajax+php学习笔记
昨天研究ajax,想作个登陆框,无刷新就把用户名密码提交给后台php程序,验证后发回. 几经琢磨 总算出来前台代码: <script src="./javascript/jquery- ...
- HDU 1016 Prime Ring Problem (素数筛+DFS)
题目链接 题意 : 就是把n个数安排在环上,要求每两个相邻的数之和一定是素数,第一个数一定是1.输出所有可能的排列. 思路 : 先打个素数表.然后循环去搜..... #include <cstd ...
- zoj 3513 Human or Pig 博弈论
思路:P态的所有后继全为H态,第一个格子为P态,第一行和第一列为H态. 代码如下: #include<iostream> #include<cstdio> #include&l ...