Eclipse不认识“R.id ...”与Android [英] Eclipse not Recognizing "R.id..." with Android

查看:304
本文介绍了Eclipse不认识“R.id ...”与Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何想法为什么有时候Eclipse卷曲,并且不识别它在几秒前做的代码?下面的代码中的R在5分钟前没有红色波浪,而且我没有更改代码。这通常与Eclipse发生,通常我关闭它并重新开始,这是很好的...不要走这个时候。

  //初始化视图元素
mSearchBox =(EditText)this.findViewById(R.id.edittext_search);
mSearchButton =(Button)this.findViewById(R.id.button_search);


解决方案

听起来像R类需要重新生成,尝试对布局文件进行更改并保存,以便项目重建。


Any ideas why at times Eclipse frizzles and doesn't recognize code it did seconds ago? The "R" in the code below has the red squiggle under it when it didn't 5 minutes ago and I've change no code. This happens frequently with Eclipse and usually I shut it down and start it again and it's good to go...no go this time.

// Initialize view elements
    mSearchBox      = (EditText) this.findViewById(R.id.edittext_search);
    mSearchButton   = (Button) this.findViewById(R.id.button_search);

解决方案

it sounds like the R class needs to be regenerated, try making a change to the layout file and saving it so the project rebuilds.

这篇关于Eclipse不认识“R.id ...”与Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆