Any one give idea, Timer will be schedule based on duration array and if once complete duration array length again will be start from first. In this some loop working perfectly some times will be crash and through arrayoutofboundsexception. Any one cane Help Me???
int[] duration={10000,2000,8000};
int layoutIncrment=-1;
private void layoutRotate()
{ layoutIncrment++;
Timer timer = new Timer();
timer.schedule(new TimerTask()
{ public void run()
{
if((duration.length-1) <= layoutIncrment)
layoutIncrment=-1;
layoutRotate();
Log.i("Rotation",String.valueOf(layoutIncrment));
} },duration[layoutIncrment],100000);
}