Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我进行了很多搜索,总是发现警报管理器总是在广播接收器的帮助下开始,而不是直接使用服务。我想知道为什么会这样,请告诉我
根据您的 Pending Intent,警报管理器可以启动服务、广播接收器或活动。
getActivity(Context, int, Intent, int), getBroadcast(Context, int, Intent, int), getService(Context, int, Intent, int);
您可以使用任何待处理的 Intent 方法,您的警报将提示活动或接收器或服务。