Activity方法:
onCreate()
onRestart()
onStart()
onResume()
onPause()
onStop()
onDestroy()
,
onSaveInstanceState()
onRestoreInstanceState()
,
Service方法:
void onCreate()
void onStart(Intent intent)
void onDestroy()
Context.startServicel(),Context.stopService()
Service.stopSelf(),Service.stopSelfResult().
Context.bindService(),Context.unbindService().
如果一个服务允许别的进程绑定,则它还会有以下额外的回调方法以供实现:
IBinder onBind(Intent intent)
boolean onUnbind(Intent intent)
void onRebind(Intent intent)