Android 遍历界面控件

//遍历界面上的控件 fubin.pan
LinearLayout sLinerLayout = (LinearLayout)findViewById(R.id.layout_scr);
for (int i = 0; i < sLinerLayout.getChildCount(); i++) {
View v=sLinerLayout.getChildAt(i);
if ( v instanceof RadioGroup){
RadioGroup mRadioGroup = (RadioGroup)sLinerLayout.getChildAt(i);
//根据ID获取RadioButton的实例
RadioButton rb = (RadioButton)questionitemlist2.this.findViewById(mRadioGroup.getCheckedRadioButtonId());
if (rb.getTag(R.id.tag_toend).toString().equals(""))//判断ToEnd监听
{

}else if(rb.getTag(R.id.tag_tonext).toString().equals(""))//判断ToNext监听
{

}
}

}

Android 遍历界面控件,布布扣,bubuko.com

Android 遍历界面控件

上一篇:.Net 转战 Android 4.4 日常笔记(10)--ADT集成环境更新SDK


下一篇:libgdx学习记录19——图片动态打包PixmapPacker