// Get handles for the context and the telephony manager.
context = this
telephonyManager = getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
+ }
+
+ override fun onResume() {
+ // Run the default commands.
+ super.onResume()
- // Check to see if the read phone state permission has been granted.
+ // Check to see if the read phone state permission has been granted. These commands need to be run on every resume so that the listener gets reassigned as it is automatically paused.
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) { // The storage permission has been granted.
// Populate Privacy Cell.
populatePrivacyCell()