findviewbyid找不到控件 android.R.id.mytext改为R.id.mytextandroid.R.id.mybutton改为R.id.mybutton 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 把Android去掉! 像楼上的那样! 再不行,就project--clean一下,重新构造环境。 TextView myText = (TextView)this.findViewById(android.R.id.mytext);这个有问题 TextView myText = (TextView)this.findViewById(android.R.id.mytext); Button mybutton=(Button)this.findViewById(android.R.id.mybutton); 你的R包导错了。要导你项目对应的R包 嗯,楼上说的都对。你的包导入错了。 TextView myText = (TextView)this.findViewById(android.R.id.mytext);应该改为 TextView myText = (TextView)this.findViewById(R.id.mytext);把你上面导入的删掉。然后重新导入。 把R的import给删除掉再照一楼所说的 1楼正解 http://dalvik.co.cc 你可以试下加红色的代码TextView myText = (TextView)this.myText.findViewById(android.R.id.mytext); Button mybutton=(Button)this.mybutton.findViewById(android.R.id.mybutton); 一个新手问题!Eclipse下运行两个JAVA文件老是出错! 一个布局问题 求高手解答 Eclipse和我都崩溃! 方向传感器的问题 拉我一把:帮忙解释一段android中java代码用法 NDK学习 bluetooth obexftp 求助啊 手机QQ这类手机软件是用什么计算机语言编写的 Axure新人求问如何设置编辑效果和移动效果 如何让一个圆围绕轴心转一定的角度 android连接远程数据库定时出现登陆失败
这个有问题
Button mybutton=(Button)this.findViewById(android.R.id.mybutton);
你的R包导错了。要导你项目对应的R包
TextView myText = (TextView)this.findViewById(android.R.id.mytext);
应该改为
TextView myText = (TextView)this.findViewById(R.id.mytext);
把你上面导入的删掉。然后重新导入。
Button mybutton=(Button)this.mybutton.findViewById(android.R.id.mybutton);