Android layout 当我尝试查找ViewById时,我的按钮不会出现
我知道有很多类似的问题,因为我都读过了,但我不能解决我的问题。我有史以来最简单的设置 XML 错误 我不知道这是否有什么不同,但我使用的是最新的API,Eclipse版本是Juno 非常感谢您的任何帮助 白痴警报Android layout 当我尝试查找ViewById时,我的按钮不会出现,android-layout,Android Layout,我知道有很多类似的问题,因为我都读过了,但我不能解决我的问题。我有史以来最简单的设置 XML 错误 我不知道这是否有什么不同,但我使用的是最新的API,Eclipse版本是Juno 非常感谢您的任何帮助 白痴警报 Button my_btn = (Button) findViewById(R.layout.button1); 这应该是 Button my_btn = (Button) findViewById(R.id.button1); 对不起,浪费了你的时间 把这个问题标记为你自己回答的
Button my_btn = (Button) findViewById(R.layout.button1);
这应该是
Button my_btn = (Button) findViewById(R.id.button1);
对不起,浪费了你的时间 把这个问题标记为你自己回答的问题,这样可以帮助别人
button1 cannot be resolved or is not a field MainActivity.java
Button my_btn = (Button) findViewById(R.layout.button1);
Button my_btn = (Button) findViewById(R.id.button1);