public void onShowNotification ( NotificationView view , View contentView , NotificationEntry entry , int layoutId ) { if ( DBG ) Log . v ( TAG , "onShowNotification - " + entry . ID ) ; final Drawable icon = entry . iconDrawable ; final CharSequence title = entry . title ; final CharSequence text = entry . text ; final CharSequence when = entry . showWhen ? entry . whenFormatted : null ; ChildViewManager mgr = view . getChildViewManager ( ) ; if ( layoutId == R . layout . notification_simple || layoutId == R . layout . notification_large_icon || layoutId == R . layout . notification_full ) { boolean titleChanged = true ; boolean contentChanged = view . isContentLayoutChanged ( ) ; NotificationEntry lastEntry = view . getLastNotification ( ) ; if ( ! contentChanged && title != null && lastEntry != null && title . equals ( lastEntry . title ) ) { titleChanged = false ; } mgr . setImageDrawable ( ICON , icon , titleChanged ) ; mgr . setText ( TITLE , title , titleChanged ) ; mgr . setText ( TEXT , text ) ; mgr . setText ( WHEN , when ) ; } else if ( layoutId == R . layout . notification_simple_2 ) { mgr . setImageDrawable ( ICON , icon ) ; mgr . setText ( TITLE , title ) ; mgr . setText ( TEXT , text ) ; mgr . setText ( WHEN , when ) ; } }
Called when a notification is being displayed . This is the place to update the user interface of child - views for the new notification .