When an IntentService starts, does the application object start?

I want to understand the life cycle of an object Applicationin Android, especially with IntentService.

If it IntentServicestarts, does the object begin with it Application? And what exactly is the sequence for this? Finally, when will it be destroyed in this case?

+4
source share
1 answer

An instance Applicationis a singleton. Whenever Android creates an OS to host an Android ( Activity, Service, BroadcastReceiver, Provider) component of an application, it performs the following actions:

  • Application ( )
  • onCreate() Application

Android ( ), onCreate() .

IntentService ( ):

  • Application ( Application)
  • Application.onCreate()
  • IntentService ( IntentService)
  • IntentService.onCreate()

IntentService , Android onDestroy() IntentService. , , Android .

Android IntentService, - , Android , . Application , Android . Android IntentService, IntentService.onCreate() IntentService.

Application . Android , .

+6

Source: https://habr.com/ru/post/1625640/


All Articles