我已经编写了通知并在通知栏显示的功能:
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
即使用户按下通知栏中的“清除”通知按钮?
请查看“雅虎”应用程序的通知栏。
我已经阅读了这篇 SDK 文章: http: //developer.android.com/guide/topics/ui/notifiers/notifications.html#Updating,但没有找到。