android - GetPostiosion method giving array out of bounds error -
ok somewhere in getposition method webview messing , getting array out of bounds exception. want app cycle through array list when done. if 'reloadtime' on item in array list has not passed, skip next item. if cycles through items in array list , none passed displays blank screen. everythign works except array still goes out of bounds somewhere.
private int getposition(int binary){ log.e("tree","getposition run"); //if positions right if (binary==1){ //make sure count doesnt go on array size 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; }
Comments
Post a Comment