int id = getResources().getIdentifier("cell00", "id", getPackageName());
TextView currcell = (TextView) findViewById(id);
Class clazz = R.id.class;
Field f = clazz.getField("cell" + "00");
int id = f.getInt(null); // pass in null, since field is a static field.
TextView currcell = (TextView) findViewById(id);
本文介绍了一种在Android应用中通过代码动态获取特定UI元素的方法,包括使用getIdentifier方法获得资源ID,利用反射机制getField方法获取具体组件引用的过程。

被折叠的 条评论
为什么被折叠?



