我以前是学.Net的,在windows form中要获得本窗体的控件集合用this.Controls,现在学java Android了,能获取吗?请示例~
------解决方案--------------------
ViewGroup group = (ViewGroup) findViewById(R.id.layout);
ArrayList<Button> buttonlist = new ArrayList<Button>();
int N = group.getChildCount();
for (int i = 0; i < N; i++) {
View view = group.getChildAt(i);
if (view instanceof Button)
buttonlist.add((Button)view);
}