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() {
}
}
override fun onDestroy() {
super.onDestroy()
if (vpnStateReceiver != null) requireContext().unregisterLocalReceiver(vpnStateReceiver!!)
override fun onStop() {
super.onStop()
vpnStateReceiver?.also { requireContext().unregisterLocalReceiver(it) }
}
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