【发布时间】:2013-07-30 10:12:30
【问题描述】:
在下面的java代码中:
Notification noti = nBuilder.build();
NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
noti.flags |= Notification.FLAG_AUTO_CANCEL;
this 运算符 (|=) 是什么?
【问题讨论】:
-
就像 +=,-= 等
-
|=按位包含 OR 和赋值运算符noti.flags |= Notification.FLAG_AUTO_CANCEL与noti.flags = noti.flags | Notification.FLAG_AUTO_CANCEL相同