Adh*_*ham 1 java android operators
在java中的以下代码中:
Notification noti = nBuilder.build();
NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
noti.flags |= Notification.FLAG_AUTO_CANCEL;
Run Code Online (Sandbox Code Playgroud)
这个operator(|=)是什么用的?
noti.flags |= Notification.FLAG_AUTO_CANCEL;
Run Code Online (Sandbox Code Playgroud)
手段
noti.flags = noti.flags | Notification.FLAG_AUTO_CANCEL;
Run Code Online (Sandbox Code Playgroud)
哪里| 是个Bit wise OR operator