Комментарии:
Hi, what happen if an event is emitted when the app is in background ?
ОтветитьIs there a way to cancel all events in the queue of a Channel?
ОтветитьHello @Philipp, I have watched a video for you explaining sharedFlow and I think its usage/emission looks like Channel.
If you can just clarify that :) ?
Why not used shared flow instead of channels?
ОтветитьThank you so much for your videos!🙂
ОтветитьIf i collect data through flow i can emit data wtih flow what is the benefit of channel?
ОтветитьBe blessed brother, your video are clean and crystal clear which simplify the hell life of a developer. am a huge fan.
Ответитьchannel causes problem when using it in fragment + viewPager
ОтветитьGreat content, you are a guide book for android developers
Ответитьdo we have to close the channel in viewmodel?
Ответитьcan you please do this video again, but using compose?
ОтветитьYou explain very clear.
ОтветитьWhat are the benefits of using Channels over Sharedflow?
ОтветитьCool man, i love you videos!)
Ответитьthank you philipp
ОтветитьCompared to LiveData this gives slightly different behaviour right? The event isn't guaranteed to be handled once if the LifeCycleOwner isn't in the right state. Eg if the error arrives before onStart, the event will be lost. Do you think that is ever a problem?
ОтветитьWhat if event was posted before View started collecting flow? Eg event was posted in init {} of ViewModel. In my case, that event was ignored. Upd: The solution is to set buffer size to UNLIMITED . Without that `send` will be suspended and `trySend` will be ignored until flow will be consumed.
ОтветитьWhen I call a function in the ViewModel from a DialogFragment class, and the function sends an event to the main fragment to show a toast it doesn't work. What could be the reason?
ОтветитьIt is better to use MutableSharedFlow to same goal rather than Channel, because channels are gonna be used only inside coroutines libraries and won't be available from outside.
ОтветитьThis is cool. Is there any other use case for channels apart from one time events ?
ОтветитьWhat the is the difference between Channels and MutableSharedFlow? Which use in which case?
ОтветитьI tried without button click , it still shows a snackbar when device is rotated , onclick of button , it works fine as you show but if i directly trigger the code onstart or onCreate without button click , it still shows snackbar one device rotation , any idea why , and thank you for the video , appreciated
ОтветитьYou could use asLiveData extension to safely observe the flow's data
ОтветитьHey there why don’t you make video on BLE topic it will be good to have a video in your play list😊
ОтветитьAwesome
ОтветитьExtremely clear explanation. Thanks!
ОтветитьPlease teach us about Android Profiling too... please
ОтветитьIs this better than using SharedFlow?
ОтветитьDo a in-app purchase tutorial pls
Used to unlock Pro version and when purchesed it removes ads and open premium content
Fantastic tutorials. Thanks!
Ответитьvery cool video
wish you all the best 👍👍👍
Thank you, Philipp, I didn't know about Channels 😱
Ответитьthank you !
ОтветитьThanks Philip had problems managing 1 time events, did not know of any in-built way
Ответитьplease sir make some video with dynamic broadcast receiver and download manager it will be very helpful for every Android developer .
Please 🙏
😍😍😍
ОтветитьIs there any clear advantage to using this over Google's Event wrapper class, in your opinion? Or is it more like just your preferred pattern to use?
ОтветитьThank you philipp , i have one question , when you observe flow in main activity , is it lifecycle aware as like Live Data ?
ОтветитьYou don't have to use the channels. They are complicated and not worth it.
ОтветитьWhy don't you use the sharedFlow ? It would be even easier
ОтветитьWait, the Event sealed class is actually a thing? I came up with that on my own like a couple of weeks ago and thought I was a genius lmao. Before that I'd just have a bunch of LiveDatas with different events in every VM XD
It sure is better this way than with the custom Event class though. Thanks for the video! :)
Voice got 🔥
Ответитьlast night, i was searching this problem in ur channel and now u hv uploaded this video,, omg amazing 👏 connection
ОтветитьIf need get string for message from resouses, in this case pass context in viewModel?
Ответитьshould the event sealed class always be in the viewmodel or if we have a repository we put it in the repository?
ОтветитьGreat demo
Ответитьdoes we have to create both livedata and channel in viewmodel separately based on the events...i.e for single events channel and livedata for the normal behaviour.
Ответить