【发布时间】:2013-07-03 10:05:45
【问题描述】:
我在应用程序源代码中找到了这一行,但我无法弄清楚两个标志之间的按位或包含运算符“|”的含义。
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP);
下面一行中这个运算符|=的含义我也没有理解:
notification.flags |= Notification.FLAG_AUTO_CANCEL;
有人可以帮帮我。
【问题讨论】:
-
和notification.flags一样= notification.flags | Notification.FLAG_AUTO_CANCEL;只是一个简短的形式。
-
@RenéLink 除了
notification.flags仅被评估一次。 -
人们喜欢被反复提出(和回答)的问题。