Guys someone help me please, i'am doing very fast update to the local database (room) the problem is sometimes the database is not updating, i tried viewModelLunch scope and dispatcher IO , any one can help or have idea please and thank you ..
You need to make a scope for database handling wider than your view model. For example, create a repository tied to app lifecycle. In this case your jobs will not be cancelled by narrow view model scopes.
Very clear, it really helped me better understand the power of coroutine scopes 👍
Great talk!
Great explanation, thanks!
nice job!
Greate talk
Guys someone help me please, i'am doing very fast update to the local database (room) the problem is sometimes the database is not updating, i tried viewModelLunch scope and dispatcher IO , any one can help or have idea please and thank you ..
You need to make a scope for database handling wider than your view model. For example, create a repository tied to app lifecycle. In this case your jobs will not be cancelled by narrow view model scopes.
@@alexanderbernat182 I will try that thank you
Is it mean that Activity initiate a Thread and exist until the Activity destroyed then other components could use that Thread to do asynchronous job?
no, all code you write in an activity is by default run in the single ui thread