我有不同的通知,每個通知都有與它們相關的不同捆綁/活動。我的問題是,一旦點擊它們就不會消失。儘管它們並未處於正在進行的通知之下,並且「清除」將其清除。貝婁是我的代碼。任何想法將不勝感激。 :)Android通知不會消失(即使使用Auto_Cancel)
private void showNotification(Bundle b){
CharSequence myText = b.getString("notifStr");
Notification notification = new Notification(R.drawable.stat_sample, myText,System.currentTimeMillis());
Intent i = new Intent(myContext, NewPlace.class);
i.setAction(Intent.ACTION_VIEW + Integer.toString(b.getInt("id")));
i.putExtras(b);
PendingIntent contentIntent = PendingIntent.getActivity(myContext, 0, i, 0);
notification.defaults |= Notification.FLAG_AUTO_CANCEL;
notification.setLatestEventInfo(myContext, myText,myText, contentIntent);
notifMan.notify(b.getInt("id"), notification);
}
這應該工作。 – azharb 2011-04-15 17:51:34