override fun onStart() { super.onStart() broadcastReceiver = object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { // Fetch and use new values } } this.registerReceiver(broadcastReceiver, IntentFilter(Intent.ACTION_APPLICATION_RESTRICTIONS_CHANGED)) } public override fun onStop() { super.onStop() if (broadcastReceiver != null) { this.unregisterReceiver(broadcastReceiver) broadcastReceiver = null } }