imgv is a array contain id's of image view
如何在图像中存储图像视图ID并在特定图像视图元素上设置图像资源?
答案 0 :(得分:0)
你不能在int数组上使用setImageResource这个方法必须在ImageView对象上使用
将drawable设置为此ImageView的内容。
文档中的更多说明 ImageView
只需你可以做这样的事情
int[] array = {R.drawable.imag_view_1,R.drawable.imag_view_3,R.drawable.imag_view_2};
imageView.setImageResource(array[0]);