http://ads.buzzcity.net/adpage.php?partnerid=40096
分类: LINUX
2010-04-17 23:18:39
try
{
Class klazz = Class.forName(
"com.huangzhimin.android.R$drawable"
);
Field[] fields = klazz.getFields();
mImageIds =
new
int
[fields.length -
1
];
int
i =
0
;
for
(Field field : fields) {
if
(!field.getName().equals(
"icon"
)) {
mImageIds[i] = field.getInt(klazz);
i++;
}
}
}
catch
(Exception e) {
e.printStackTrace();
}
注意drawable是R的内嵌静态类,所以要写成com.huangzhimin.android.R$drawable。