Problems with the android custom notification bar
First, check the error message:
E/AndroidRuntime (12220): fatal exception: main
E/AndroidRuntime (12220): Process: gn.com. android. update, PID: 12220
E/AndroidRuntime (12220): android. app. remoteServiceException: Bad notification posted from package gn.com. android. update: Couldn't expand RemoteViews for: StatusBarNotification (pkg = gn.com. android. update user = UserHandle {0} id = 1 tag = null score = 0 key = 0 | gn.com. android. update | 1 | null | 10038: Notification (pri = 0 contentView = gn.com. android. update/0x7f03000a vibrate = null sound = null defaults = 0x0 flags = 0x20 color = 0x00000000 vis = PRIVATE ))
E/AndroidRuntime (12220): at android. app. ActivityThread $ H. handleMessage (ActivityThread. java: 1580)
E/AndroidRuntime (12220): at android. OS. Handler. dispatchMessage (Handler. java: 106)
E/AndroidRuntime (12220): at android. OS. Looper. loop (Looper. java: 189)
E/AndroidRuntime (12220): at android. app. ActivityThread. main (ActivityThread. java: 5532)
E/AndroidRuntime (12220): at java. lang. reflect. Method. invoke (Native Method)
E/AndroidRuntime (12220): at java. lang. reflect. Method. invoke (Method. java: 372)
E/AndroidRuntime (12220): at com. android. internal. OS. ZygoteInit $ MethodAndArgsCaller. run (ZygoteInit. java: 950)
E/AndroidRuntime (12220): at com. android. internal. OS. ZygoteInit. main (ZygoteInit. java: 745)
The Code is as follows:
The notification bar defines a control in the layout as follows:
Android: id = "@ + id/notificationImage"
Android: layout_width = "@ android: dimen/notification_large_icon_width"
Android: layout_height = "@ android: dimen/icationication_large_icon_height"
Android: scaleType = "center"
Android: clickable = "true"
Android: background = "@ * android: drawable/yy_panel_icationication_icon_bg_tile"
Android: src = "@ drawable/stat_sys_download_anim0"
/>
The code in java is as follows:
If (null = mNotification ){
MContentIntent = PendingIntent. getActivity (this, 0, new Intent (this, SettingUpdate. class), 0 );
// A new notification object
MNotification = new Notification (R. drawable. stat_sys_download_anim0,
GetString (R. string. policy_auto_update_title), System. currentTimeMillis ());
MNotification. flags = Notification. FLAG_NO_CLEAR;
}
MNotification. icon = R. drawable. stat_sys_download_anim0;
Solution:
If you delete the android: src = "@ drawable/stat_sys_download_anim0" sentence, no error is reported, but the error is displayed as black. It was initially estimated that the problem was caused by systemui. I do not know the cause. Please reply to me. Thank you.