Null pointer exception error in getBooleanArrayExtra() in Android studio

I am getting a null pointer exception error while running my code on Android device. I don’t know how to resolve it…
here is my code

For main activity

package com.example.quizappcwh;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.SparseBooleanArray;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private Button yes;
private Button no;
private TextView questionText;
private final String() QuestionsList = {
“1) Python is an interpreted language”,
“2) To execute Python statements, the statements must be entered into a
file”,
“3) Python’s print statement writes items to the screen”,
“4) A full list of Python keywords can be obtained from Python itself,
using the Python keyword module”,
“5) A variable called name refers to the same value as a variable called
NAME”,
“6) The keyword function marks the beginning of a function definition”,
“7) Python determines the beginning and end of a statement based on
whitespace”,
“8) Function int retrieves an integer from a program user”,
“9) Python has three high-level data structures: lists, dictionaries and
hashes”,
“10) Tuples are immutable data types; lists are mutable data types”,
“11) List method append adds an element to the end of the list”,
“12) Dictionary values must be immutable data types”,
“13) Single quote characters (‘) inside a string must be “escaped” using
the backslash character (i.e. ‘)”,
“14) Regular expression processing is built into the Python language”,
“15) The compile function of module re returns an instance of a
SRE_Pattern object”,
“16) None is a Python type whose value indicates that no value exists”
};
boolean() AnswersList = {
true,false,true,true,false,false,true,false,
false,true,true,false,false,false,true,true
};
private int index = 0;
boolean() userInput = new boolean(16);
int score = 0;
void updateScore(){
boolean() a = userInput;
Intent intent = new Intent(this, MainActivity2.class);
intent.putExtra(“INPUT_ANSWERS”,a);
intent.putExtra(“FINAL_SCORE”, score);
startActivity(intent);
}
void calScore(){
for(int i=0;i<16;i++){
if(AnswersList(i)==userInput(i)){
score+=1;
}
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
yes = findViewById(R.id.yes);
no = findViewById(R.id.no);
questionText = findViewById(R.id.questionText);
questionText.setText(QuestionsList(index));
yes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(index<=QuestionsList.length-1)
{
userInput(index) = true;
index++;
if(index<=QuestionsList.length-1) {
questionText.setText(QuestionsList(index));
}
else{
calScore();
updateScore();
}
}
else{
calScore();
updateScore();
}
}
});
no.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(index<=QuestionsList.length-1)
{
userInput(index) = false;
index++;
if(index<=QuestionsList.length-1) {
questionText.setText(QuestionsList(index));
}
else{
calScore();
updateScore();
}
}
else{
calScore();
updateScore();
}
}
});
}
}

For main activity 2

package com.example.quizappcwh;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity2 extends AppCompatActivity {
private Button previous;
private Button next;
private TextView uaText;
private TextView caText;
private TextView ExpText;
private String() explanation = {
“Explanation: Python is an interpreted language.”,
“Explanation: Python can execute programs stored in files, or it can run
in interactive mode, where users enter lines of code one at a time.”,
“Explanation: Python’s print statement writes items to the screen.”,
“Explanation: A full list of Python keywords can be obtained from Python
itself, using the Python keyword module.n”,
“Explanation: Python is case-sensitive, so name and NAME are two different
variable names.”,
“Explanation: The keyword def marks the beginning of a function
definition.”,
“Explanation: Python determines the beginning and end of a statement based
on whitespace.”,
“Explanation: Function raw_input may be used to retrieve input from the
user. Function int changes returns a non-integer value when passed an integer value.”,
“Explanation: Python’s three high-level data structures are tuples, lists
and dictionaries.”,
“Explanation: Tuples are immutable data types; lists are mutable data
types.”,
“Explanation: List method append adds an element to the end of the list.”,
“Explanation: Dictionary values may be of mutable data types; dictionary
keys, however, must be of immutable data types.”,
“Explanation: When placed within a string, the double quote character (“)
needs to be “escaped” using a backslash, so as not to be confused with one of the
characters delimiting the string.”,
“Explanation: Regular expression processing is contained in the re module.
This module must be imported to perform regular expression processing tasks.”,
“Explanation: The compile function of module re returns an instance of a
SRE_Pattern object.”,
“Explanation: None is a Python type whose value indicates that no value
exists.”,
};
Intent intent = getIntent();
boolean() correct_answers = {
true,false,true,true,false,false,true,false,
false,true,true,false,false,false,true,true
};
boolean() user_answers = intent.getBooleanArrayExtra(“INPUT_ANSWERS”);
// int final_score = intent.getIntExtra(“FINAL_SCORE”,0);
private int i = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
uaText = findViewById(R.id.uaText);
caText = findViewById(R.id.caText);
ExpText = findViewById(R.id.ExpText);
next = findViewById(R.id.next);
previous = findViewById(R.id.previous);
setContent(0);
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(i<16 && i>=0){
i+=1;
if(i<16){
setContent(i);
}
else{
Toast.makeText(MainActivity2.this, “Invalid Option”,
Toast.LENGTH_SHORT).show();
}
}
else{
Toast.makeText(MainActivity2.this, “Invalid Option”,
Toast.LENGTH_SHORT).show();
}
}
});
previous.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(i<16 && i>=0){
i-=1;
if(i>=0){
setContent(i);
}
else{
Toast.makeText(MainActivity2.this, “Invalid Option”,
Toast.LENGTH_SHORT).show();
}
}
else{
Toast.makeText(MainActivity2.this, “Invalid Option”,
Toast.LENGTH_SHORT).show();
}
}
});
}
private void setContent(int x){
uaText.setText(Boolean.toString(user_answers(x)));
caText.setText((Boolean.toString(correct_answers(x))));
ExpText.setText(explanation(x));
}
}