• 2022-05-31
    当其他组件调用startService()方法时,服务被创建。接着服务无限期运行,其自身必须调用_______方法或者其他组件调用______________方法来停止服务。当服务停止时,系统将其销毁。
  • stopSelf()#stopService()

    举一反三

    内容

    • 0

      当通过startService()方法启动服务时,执行的生命周期方法为onCre...)方法时服务停止,最终被系统销毁。( )

    • 1

      其他组件,例如Activity调用startService()方法请求服务启动时,系统将调用下面的( )方法。 A: onCreate() B: onStartCommand() C: onBind() D: onDestroy()

    • 2

      当应用程序组件通过调用()方法时,服务处理绑定状态?

    • 3

      当应用程序组件(例如Activity)通过调用startService()方法启动服务时,服务处于()状态。 A: “bound” B: “activate” C: “started” D: “block”

    • 4

      当其他组件想要通过bindService()来绑定服务时,系统调用那个方法() A: onStartCommand() B: onBind() C: onUnbind() D: onRebind()