我有两个通知动作,一个是停止服务,另一个是重启服务。我可以成功启动服务,但无法使用以下代码停止它:
PendingIntent show = PendingIntent.getService(this, 1, svc, PendingIntent.FLAG_UPDATE_CURRENT);
PendingIntent hide = PendingIntent.getService(this, 1, svc, PendingIntent.FLAG_CANCEL_CURRENT);
你有什么想法吗?
这不是一个重复的问题,因为我的问题特别涉及到通知操作,而不是按钮(我没有任何问题让我的按钮停止和启动服务)。