我已经写了通知栏中显示的功能:
- 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,notificationIntent,0);
- notification.setLatestEventInfo(Main_Activity.this,title,message,pendingIntent);
- notificationManager.notify(NOTIFICATION_ID,notification);
- }
它的工作正常,但是即使用户按通知栏中的“清除”通知按钮,我们还能以什么方式将通知保持在通知栏?
请查看“雅虎”应用程序的通知栏.
我已经通过这个SDK文章:http://developer.android.com/guide/topics/ui/notifiers/notifications.html#Updating,但没有找到.