Hi, I'm testing this in android api 31, I'm not sure if this problem is also present on other android versions.
If I start the connectivity status, stop it and then start it again I get this error message:
E/ConnectivityManager: NetworkCallback was already registered
Apparently the networkCallback is not being unregistered when I call the stop function.
A new local ConnectivityManager object appears to be generated every time you call the start() function, thus it is never stored within the ConnectivityStatus object and it cannot be used to unregister the callback.
Hi, I'm testing this in android api 31, I'm not sure if this problem is also present on other android versions. If I start the connectivity status, stop it and then start it again I get this error message:
Apparently the networkCallback is not being unregistered when I call the stop function.
I believe this is related to this line https://github.com/ln-12/multiplatform-connectivity-status/blob/7684f38d74c67db96449334b5e9b7d14e415fa7f/src/androidMain/kotlin/com/github/ln-12/library/ConnectivityStatus.kt#L30
A new local ConnectivityManager object appears to be generated every time you call the start() function, thus it is never stored within the ConnectivityStatus object and it cannot be used to unregister the callback.