已解决……
问题不在于ACTION_TIME_TICK,而是我中途调用的方法会在特定情况下stopself
我本以为在service中加的那个notification会随着stopself消失,结果它没消失……于是我以为是广播出了问题……
以下是原题……
——————————————————————————————————————————————————————————————————————
我看google是这么说的
Broadcast Action: The current time has changed. Sent every minute. You
cannot receive this through components declared in manifests, only by
explicitly registering for it with Context.registerReceiver().
于是我的代码:
public class AlarmService extends Service {
......
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
builder.setSmallIcon(R.drawable.alarm_notify);
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);