stopSelf() vs stopSelf(int) vs stopService(Intent)

后端 未结 7 1300
鱼传尺愫
鱼传尺愫 2020-12-29 00:56

What\'s the difference in calling
stopSelf() , stopSelf(int) or stopService(new Intent(this,MyServiceClass.class))
inside

7条回答
  •  心在旅途
    2020-12-29 01:51

    stopSelf()=Stop the service, if it was previously started.

    stopSelf(int startId)=Old version of stopSelfResult(int) that doesn't return a result.

    stopSelfResult(int startId)=Stop the service if the most recent time it was started was startId.Its return boolean result.

提交回复
热议问题