【发布时间】:2012-02-06 15:34:06
【问题描述】:
当用户从服务器选择他选择的图像时,我需要将图像动态添加到 res/drawable 文件夹中......然后将相应的R.drawable.imageid 存储到数据库中......以便在下一个加载用户选择的图像跑……有没有办法……?
int[] images = {
R.drawable.m1,R.drawable.m2, R.drawable.m3,
R.drawable.m4,R.drawable.m5, R.drawable.m6,
R.drawable.m7, R.drawable.m8,
R.drawable.m9
};
ImageView iv = (ImageView)findViewById(imageViews[next]);
iv.setImageResource(images[j]);
这里R.drawable.m1、R.drawable.m2、R.drawable.m3、R.drawable.m4、R.drawable.m5、R.drawable.m6、R.drawable.m7、R.drawable.m8、R.drawable.m9应该是用户从服务器选择的图像的ID
【问题讨论】:
-
提问时请不要大喊大叫。这使它们更难阅读。您也不需要将相同的信息放入标签中的标题中,如果您使用真实的单词(“the”而不是“d”,“should”而不是“shd”等)会有所帮助);并非所有可能为您提供帮助的人都是以英语为母语的人(或理解噪音),您的问题越清晰,您就越有可能很快得到答案。谢谢。 :)
标签: android