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

后端 未结 7 1311
鱼传尺愫
鱼传尺愫 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:39

    There are two flavors of stopSelf(). One takes a startId parameter, to indicate that you have completed work on one specific command, and so the service should opportunistically stop if there are no other outstanding commands.

提交回复
热议问题