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); ubuntu下编译啊android源码报错,大神指点,在线等 android ndk 编译so动态库的问题 下载Android4.0代码repo sync失败问题 发了1个通知,为啥app退出以后收不到? 急急急!求帮助 android的"系统设置"用的什么组件 eclipse 如何导入新浪微博的java sdk Widget 控件横竖屏切换时失效 分享两年来的工作成果 用MKEY中间件来做手机开发,有毛的前途 如何让一个圆围绕轴心转一定的角度 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);