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?
Asked
Active
Viewed 1,256 times
3
-
Start an application from a Service? Do you mean Activity? – Spidy Jun 29 '11 at 23:29
1 Answers
3
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.

jakebasile
- 8,084
- 3
- 28
- 34
-
If starting service in it's own process it will call Application's onCreate. If it's called per process how to know which one.. – dykzei eleeot Jun 05 '13 at 06:54
-
This is how you get the current process name - https://stackoverflow.com/questions/19631894/is-there-a-way-to-get-current-process-name-in-android – Veeresh Charantimath Jul 16 '19 at 10:33