【发布时间】:2012-09-15 08:39:53
【问题描述】:
我的布局文件中有 4 个按顺序编号的按钮。在我的代码中,我想在循环中获取与我们在循环中的位置相对应的广告,例如在循环中第二次我会得到 advert2。
谁能帮忙。谢谢
Button advert1 = (Button) findViewById(R.id.advert1);
Button advert2 = (Button) findViewById(R.id.advert2);
Button advert3 = (Button) findViewById(R.id.advert3);
Button advert4 = (Button) findViewById(R.id.advert4);
【问题讨论】:
标签: android findviewbyid