+ // Handle clicks on the MHT checkbox.
+ mhtCheckBox.setOnClickListener {
+ // Update the visibility of the MHT explanation text view.
+ if (mhtCheckBox.isChecked) {
+ mhtExplanationTextView.visibility = View.VISIBLE
+ } else {
+ mhtExplanationTextView.visibility = View.GONE
+ }
+ }
+
+ // Restore the MHT explanation text view visibility if the saved instance state is not null.
+ if (savedInstanceState != null) {
+ // Restore the MHT explanation text view visibility.
+ if (savedInstanceState.getBoolean(MHT_EXPLANATION_VISIBILITY)) {
+ mhtExplanationTextView.visibility = View.VISIBLE
+ } else {
+ mhtExplanationTextView.visibility = View.GONE
+ }
+ }
+