我试图通知简单的通知,就像Java代码中一样
kotlin中这一行的语法是什么?
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_ONE_SHOT | Intent.FLAG_ACTIVITY_NEW_TASK);在kotlin中,我不能对两个标志使用‘AC.26’,只像这样:
stackBuilder.getPendingIntent(0,PendingIntent.FLAG_ONE_SHOT)发布于 2017-06-25 07:21:59
您可以在正式文档这里中找到可用的按位操作。这些都是用Kotlin语言而不是使用特殊符号来拼写的infix函数。
在您的情况下,您可以执行以下操作:
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_ONE_SHOT or Intent.FLAG_ACTIVITY_NEW_TASK);https://stackoverflow.com/questions/44744077
复制相似问题