我正在android上做一个帮助台应用程序。我想对未读票(客户建议或投诉)实施通知。在这个应用程序的iPhone版本中,即使应用程序本身没有在应用程序图标上打开未读票的计数器,在android中也可以。如果是这样,请帮助我像 iPhone 一样实施,否则请帮助我为未读门票实施正常的 android 通知。
谢谢
我正在android上做一个帮助台应用程序。我想对未读票(客户建议或投诉)实施通知。在这个应用程序的iPhone版本中,即使应用程序本身没有在应用程序图标上打开未读票的计数器,在android中也可以。如果是这样,请帮助我像 iPhone 一样实施,否则请帮助我为未读门票实施正常的 android 通知。
谢谢
调用这个方法
private void triggerNotification(String s) {
CharSequence title = "Hello";
CharSequence message = s;
NotificationManager notificationManager;
notificationManager = (NotificationManager) context
.getSystemService("notification");
Notification notification;
notification = new Notification(
com.yourPackage.R.drawable.notification, "Notifiy.. ",
System.currentTimeMillis());
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
null, 0);
notification.setLatestEventInfo(context, title, message, pendingIntent);
notificationManager.notify(1010, notification);
}