我想取消所有在后台设置的通知和警报,因为app会被滑动杀死。此操作不会在根Activity中触发onDestroy()。我做了一个后台服务,调用NotificationManager并在后台取消所有通知,如果app被滑动杀死。这导致了Android O及更高版本中的一些服务问题。,并显示错误:Reason: Context.startForegroundService() did not then call Service.startForegroun
如何在点击通知的同时取消告警/停止告警振铃,同时关闭告警?这里有两个类,设置闹钟的MyBroadcastReceiver和AddVitamin类。 这是针对AddVitamin类的。CharSequence name = context.getResources().getString(R.string.app_name);// The user-visible name of theBuild.VERSION_CODES