I suggest the following technique. It only checks if pointer gets out of boundaries of array and points it either to the end of it or beginning:
public int nextPrev(int mCurrentIndex, int direction) {
mCurrentIndex = mCurrentIndex + direction;
if(mCurrentIndex == mQuestionBank.length) {
mCurrentIndex = 0;
} else if (mCurrentIndex < 0) {
mCurrentIndex = mQuestionBank.length - 1;
}
return mCurrentIndex;
}
This will work with direction = 1 or -1.