I am little bit confused in coroutine. i just trie...
# coroutines
a
I am little bit confused in coroutine. i just tried this code and i want this code to check the network if offline Ops! offline or online You are online it works but when i touch the R*etry(*in snackbar action) button the snack bar dismiss
s
and what is your question?
a
When I touch Retry in snack bar it dismiss but I want was to check the network
s
1. check is being started nearly at same time as snackbar is shown 2. you cannot start same coroutine twice,
checkNetwork.start()
after
checkNetwork.join()
won’t do anything as it is already finished 3. you have to think about code structure, try to write in sentences what you wan’t to do and make it declaratively according to what you have written, it will help you and to understand your code as it requires lots of time to understand it
👍 1
4.
Snackbar::setAction
dismisses snackbar after action processing
👍 1