forked from AndreyAsadchy/Xtra
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot start a stream, because isNetworkAvailable not updated #592
Comments
yeah this should probably be updated. i looked at it before and i have this code saved but i don't remember if it works or not.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cannot start a stream, because isNetworkAvailable not updated and isInitialized = false here: https://github.com/crackededed/Xtra/blob/master/app/src/main/java/com/github/andreyasadchy/xtra/ui/player/BasePlayerFragment.kt#L207 .
Debugged and found that on com/github/andreyasadchy/xtra/ui/common/BaseNetworkFragment.kt:51 online = false, even though wifi is ON. It started happening ~2 months ago. I suppose because of these change
https://github.com/crackededed/Xtra/blob/master/app/src/main/java/com/github/andreyasadchy/xtra/ui/common/BaseNetworkFragment.kt#L50
https://github.com/crackededed/Xtra/blob/master/app/src/main/java/com/github/andreyasadchy/xtra/ui/main/MainViewModel.kt#L91
(within this commit fd2fe31)
Looks like it's happening only on inactive WiFi disconnection (when device was left for >10 mins), because when I turn on/off wifi manually it works well.
Probably isNetworkAvailable wasn't updated properly and before, but this refactoring revealed this issue. Or maybe it's because android target version change. Also it relies on
ConnectivityManager.CONNECTIVITY_ACTION
which is deprecated. Any ideas if it could be connected?I have to disable and enable wifi to workaround it.
Looks like we should go with a job like https://stackoverflow.com/questions/48527171/detect-connectivity-change-in-android-7-and-above-when-app-is-killed-in-backgrou
The text was updated successfully, but these errors were encountered: