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的更多相关文章

  1. findViewById(R.id.btn_first) 给写成 R.layout.

    窗体内放了个按钮, findViewById(R.id.btn_first) 给写成 R.layout. 在java 里边引用结果就是找不到那个id 找了半天找不到原因, 奔着网上常见R找不到的问题, ...

  2. 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 ...

  3. 初学时遇到的小问题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 ...

  4. Android java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or its superclasses

    项目开发快到尾声,突然发现之前一个模块莫名其妙的奔溃了,我的内心也是奔溃的.以前一直都是好好的,也没去动过它,为啥会出现这样的问题呢? 下面我会根据自己的理解来看待问题 android是怎么根据id查 ...

  5. 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 ...

  6. 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; ...

  7. .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 ...

  8. 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 ...

  9. Library Project里面使用Case语句判断R.id值报错。case expressions must be constant expressions

    原文地址:http://blog.csdn.net/wchinaw/article/details/7325641 在一般的Android项目里R里面的资源声明看起来是这样的: public stat ...

随机推荐

  1. 《我是一只it小小鸟》

    <我是一只it小小鸟>一书虽然内容不多,但里面的故事极其励志,耐人寻味.虽然只花不多的时间阅读这本书,它给我的影响将会伴随一生. 他们是来自不同的院校,或本科,或半路转行:工作在不同的场所 ...

  2. 【BZOJ】【TJOI2015】线性代数

    网络流/最小割/最大权闭合图 2333好开心,除了一开始把$500^2$算成25000……导致数组没开够RE了一发,可以算是一次AC~ 咳咳还是回归正题来说题解吧: 一拿到这道题,我就想:这是什么鬼玩 ...

  3. Winform DataGridView扩展

    public class ObjectPropertyCompare<T> : IComparer<T> { private readonly PropertyDescript ...

  4. 服务端 unity

    第一个问题 https://www.google.com.hk/search?q=internal+inconsistency+looking+up+disk+image+%27vm+disk+2%2 ...

  5. 导入ApiDemo报错,找不到R文件

    1.先检查当前ApiDemo对应的SDK版本是否一致(项目右键-Properties-Android) 2.查看是什么错误.我的就是layout中的progressbar_2.xml中所有组件的id前 ...

  6. Lessons learned from manually classifying CIFAR-10

    Lessons learned from manually classifying CIFAR-10 Apr 27, 2011 CIFAR-10 Note, this post is from 201 ...

  7. 如何理解JS项目

    JS API(DOM/PhoneGap/Cordova/NodeJS/Library/Android/MongoDB....)最基础,可以看懂一行代码. -------> JS OOP, JS语 ...

  8. eclipse git 整合

    最近朋友都推荐使用github管理自己的项目,而且免费用户可以有5个仓库,恰好我也想了解下git,借此机会学习一下.github官方指南使用独立第三方git工具来进行版本控制,并不借助于eclipse ...

  9. jQuery1.9.1--attr,prop与val方法源码分析

    这里只介绍这几个方法的源码,这部分引用了一个技巧,钩子对象,用来做兼容fixed的对象,后面也有一些使用.钩子对象具体的兼容细节这里就不详解了. var nodeHook, boolHook, rcl ...

  10. 一张思维导图说明jQuery的AJAX请求机制

    比文字描述清晰多了吧?而且越是复杂的逻辑,思维导图的作用就越大,同时对阅读源码也是一种快捷的方法. 看不清楚的话可以右键,在新标签页中打开图片,或者保存本地.