GeoQuiz next button not navigating to last question but previous button shows last question

Posting the whole code in my main activity. Please help me how can a show my last question also when I click next button.

package com.example.quiznew;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
private Button mTrueButton; //inflated widget
private Button mFalseButton; //from layout
private Button mNextButton;
private Button mPreviousButton;
private TextView mQuestionTextView;
private TrueFalse mQuestionBank = new TrueFalse{
new TrueFalse(R.string.qus_1, true),
new TrueFalse(R.string.qus_2, false),
new TrueFalse(R.string.qus_3,true),
new TrueFalse(R.string.qus_4,false),
};
private int mCurrentIndex = 0;
private int totalQuestion = mQuestionBank.length - 1;
private void updateQuestion(){
int question = mQuestionBank[mCurrentIndex].getQuestion();
mQuestionTextView.setText(question);
}
private void checkAnswer(boolean userPressedTrue){
boolean answerIsTrue = mQuestionBank[mCurrentIndex].isTrueQuestion();
int msgResId = 0;
if (userPressedTrue == answerIsTrue){
msgResId = R.string.correct_toast;
} else {
msgResId = R.string.incorrect_toast;
}
Toast.makeText(this, msgResId, Toast.LENGTH_SHORT).show();
}

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mQuestionTextView = (TextView)findViewById(R.id.qus_view);
    int question = mQuestionBank[mCurrentIndex].getQuestion();
    mQuestionTextView.setText(question);

    mNextButton = (Button)findViewById(R.id.next_button);
    mNextButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mCurrentIndex = (mCurrentIndex + 1) % totalQuestion;
            updateQuestion();
        }
    });

    mPreviousButton = (Button)findViewById(R.id.previous_button);
    mPreviousButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mCurrentIndex = (mCurrentIndex - 1) % totalQuestion;
            if (mCurrentIndex < 0){
                mCurrentIndex = totalQuestion;
            }
            else {
                mCurrentIndex = mCurrentIndex;
            }
            updateQuestion();
        }
    });

    mTrueButton = (Button)findViewById(R.id.true_button); //calling button by id
    mTrueButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            checkAnswer(true);
        }
    });

    mFalseButton = (Button)findViewById(R.id.false_button);
    mFalseButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            checkAnswer(false);
        }
    });

    mQuestionTextView = (TextView)findViewById(R.id.qus_view);
    mQuestionTextView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mCurrentIndex = (mCurrentIndex + 1) % totalQuestion;
            updateQuestion();
        }
    });
}

}

totalQuestion is being set to mQuestion.length - 1 which is 4 - 1, or 3.

Then when mNextButton is clicked, it mods the current index by totalQuestion which is the same as % 3 and results in possible values of 0, 1, or 2 so the last question is not possible.

When setting totalQuestion it should really be

private int numTotalQuestions = mQuestion.length;

then when the next button is clicked you would do

mCurrentIndex = (mCurrentIndex + 1) % numTotalQuestions;

Additionally, a trick for the previous button is

mCurrentIndex = (mCurrentIndex - 1+ numTotalQuestions) % numTotalQuestions;

This eliminates the need for the if else statement and the redundant else.