读书人

失去id的方法

发布时间: 2012-08-30 09:55:54 作者: rapoo

得到id的方法

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); 

读书人网 >移动开发

热点推荐