简体   繁体   中英

onStart method is being called in a bound service without any method call

I have been going through the following google tutorial , and just had a few questions:

  1. i pasted the code and ran it, and i noticed that the onStart() method gets executed. However I do not see any method call for this, how does this method get executed ?

  2. can you give an practical example of how a bound service would be ideal ?

  • That is because onStart() is called by an event, specifically, it is called when the activity becomes visible to the user.

Here's a nice explanation of the lifecycle of Android activities :

Android Activity Licecycle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM