5

我正在android上做一个帮助台应用程序。我想对未读票(客户建议或投诉)实施通知。在这个应用程序的iPhone版本中,即使应用程序本身没有在应用程序图标上打开未读票的计数器,在android中也可以。如果是这样,请帮助我像 iPhone 一样实施,否则请帮助我为未读门票实施正常的 android 通知。

谢谢

4

2 回答 2

9

调用这个方法

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);
}
于 2011-08-11T06:21:44.353 回答
3

这可能会有所帮助:http: //developer.android.com/guide/topics/ui/notifiers/notifications.html

于 2011-08-11T06:21:04.310 回答