好吧,在webview的getposition方法的某个地方,我搞砸了并且获得了一个超出范围的数组异常。基本上我希望我的应用程序在完成后循环遍历数组列表。但是如果重新加载时间'在数组列表中的项目尚未传递,跳转到下一个项目。如果它遍历数组列表中的所有项目并且没有传递它,则显示一个空白屏幕。 Everythign工作,除了我的数组仍然在某处出界。
private int getPosition(int binary){
Log.e("tree","getPosition run");
//if positions is to the right
if (binary==1){
//make sure count doesnt go over array size for out of index
int placeHolder;
if (position==urls.size()-1) placeHolder = position+1%(urls.size()-1);
else placeHolder = position+1;
while (System.currentTimeMillis()<urls.get(placeHolder).getReloadTime()) {
placeHolder=placeHolder+1%(urls.size()-1);
if (placeHolder==position) {
displayNone();
break;
}
} if (System.currentTimeMillis()>urls.get(placeHolder).getReloadTime()) {
position=placeHolder;
return position;
}
}else {
int placeHolder;
if (position>0) placeHolder = position-1%(urls.size()-1);
else placeHolder=urls.size()-1;
while (System.currentTimeMillis()<urls.get(placeHolder).getReloadTime()) {
placeHolder=placeHolder-1%(urls.size()-1);
if (placeHolder==position) {
displayNone();
break;
}
} if (System.currentTimeMillis()>urls.get(placeHolder).getReloadTime()) {
position=placeHolder;
return position;
}
}
return position;
}