Commit b74f136a authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Receiver has to be unregistered in onStop() when it is registered in onStart(), not in onDestroy()

parent f333f830
...@@ -221,9 +221,9 @@ class MainFragment : Fragment() { ...@@ -221,9 +221,9 @@ class MainFragment : Fragment() {
} }
} }
override fun onDestroy() { override fun onStop() {
super.onDestroy() super.onStop()
if (vpnStateReceiver != null) requireContext().unregisterLocalReceiver(vpnStateReceiver!!) vpnStateReceiver?.also { requireContext().unregisterLocalReceiver(it) }
} }
private fun startVpn() { private fun startVpn() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment