user629126
user629126

Reputation: 259

Starting service calls Application onCreate?

If you provide an extended Application class, will onCreate be called when a Service is created, even if no Activity is brought to the foreground?

Upvotes: 3

Views: 1314

Answers (1)

jakebasile
jakebasile

Reputation: 8132

Application.onCreate is called before anything in your package is instantiated.

From the documentation:

Called when the application is starting, before any other application objects have been created. Implementations should be as quick as possible (for example using lazy initialization of state) since the time spent in this function directly impacts the performance of starting the first activity, service, or receiver in a process.

Upvotes: 3

Related Questions