我已经写了通知功能,并显示在通知栏:Android的 - 保持通知持稳在通知栏
private void showNotification()
{
CharSequence title = "Hello";
CharSequence message = "Notification Demo";
NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.icon, "A Notification", System.currentTimeMillis());
Intent notificationIntent = new Intent(this, Main_Activity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
notification.setLatestEventInfo(Main_Activity.this, title, message, pendingIntent);
notificationManager.notify(NOTIFICATION_ID, notification);
}
其工作正常,但what way we can keep the notification steady at Notification bar
甚至当用户按下“清除” notificatios按钮从通知栏?
请查看“雅虎”应用程序的通知栏。
我曾经使用过此SDK文章了:http://developer.android.com/guide/topics/ui/notifiers/notifications.html#Updating,但未能找到。
你确定保持通知稳定是个好主意吗? – 2011-03-17 11:49:47
@Heiko Rupp抱歉地说是的,但它的实际要求,我必须执行。 – 2011-03-17 12:00:39
读者应该清楚这一点:使用它来宣传你的应用程序将激怒你的用户,它只应用于你需要提供一致的快速访问来控制正在运行的服务。例如:音乐应用程序(仅在播放某些内容时),导航(仅在导航路线时)或GPS记录器(在记录时)。 – 2013-05-28 08:09:46