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)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
  • 2021-11-12
  • 2022-02-16
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
相关资源
相似解决方案