Stupid question: Using GlobalScope in the Applicat...
# coroutines
j
Stupid question: Using GlobalScope in the Application class of an Android app is the same than creating a specific scope in the Application class, isn't it ?
p
Nope the globalScope is not tied to the creation off the application class
For example a contentprovider gets created before the application so using the GlobalScope there is fine but not the application scope
j
Okey thanks. But I mean, using GlobalScope in Application is okey ?
p
Depends on you, I never use it but inject it so I can swap it out in tests
馃憤 1
s
GlobalScope has no Job and is therefore not cancellable. If that's what you want use it. Creating your own scope, even if it is a app wide singleton, it will be cancellable.
馃憣 2