Eclipse 无法识别“R.id..."与安卓 [英] Eclipse not Recognizing "R.id..." with Android

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

问题描述

知道为什么 Eclipse 有时会出现毛躁并且无法识别它几秒钟前所做的代码吗?下面代码中的R"在 5 分钟前没有出现时下面有红色波浪线,我没有更改任何代码.这种情况在 Eclipse 中经常发生,通常我将其关闭并重新启动它,这很好......这次不去了.

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);

推荐答案

听起来R类需要重新生成,尝试更改布局文件并保存,以便项目重新生成.

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..."与安卓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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