【发布时间】:2012-06-04 16:15:48
【问题描述】:
我在网格视图中有一个图像列表。当我单击它以全屏心情显示的图像时,通过触摸将一个图像更改为另一个只是增加位置。这是 onTouchListener 的代码
private int position=0;
imageView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event)
{
if(event.getAction() == MotionEvent.ACTION_DOWN)
{
position++;
if( v == findViewById( R.id.full_image_view ))
{
imageView.setImageResource(imageAdapter.mThumbIds[position]);
}
}
return false;
}
});
在最后一张图片中,它显示“它已意外停止”的错误。我该如何处理索引绑定的数组?
【问题讨论】:
标签: android arrays indexoutofboundsexception