How to stop my service?

前端 未结 3 1578
挽巷
挽巷 2021-01-15 22:40

Please also see Edit 2 (below)

I have extended NotificationListenerService and implemented several of its methods including the onDestroy()

3条回答
  •  不要未来只要你来
    2021-01-15 23:02

    Place command

    stopSelf();
    

    to

    public int onStartCommand(Intent intent, int flags, int startId) {
    

    Make some variable for checking if service should be stopped.

提交回复
热议问题