I have a list of image in grid view.When i click the image it shows in full screen mood and with touch change one image to another just increasing position.here is the code for 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;
}
});
At the last image it it shows error that "it has stopped unexpectedly ".How can i handle the array of index bound?