【发布时间】:2014-10-29 12:29:39
【问题描述】:
我在 android 服务中使用此代码发送通知:
notification.setLatestEventInfo(this, "title", "text", pendingIntent);
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notificationManager.notify(id, notification);
如果应用程序关闭,此代码可以正常工作,但我也希望它在应用程序(应用程序的任何活动)打开时也发送通知,当应用程序打开时,我没有收到通知。所以请告诉我即使应用程序打开了如何接收通知。
【问题讨论】:
标签: android notifications android-service android-notifications