Reputation: 897
Recently I converted the Java code into the Kotlin like pushnotification. After the conversion its shown some error and indicate to manually correct those issues.
In Java:
.addFlags(notifyDetails.flags |= Notification.FLAG_AUTO_CANCEL);
After the conversion it's shown like
.addFlags(notifyDetails!!.flags notifyDetails!!.flags or Notification.FLAG_AUTO_CANCEL)
Also, it's indicating an error. How do I fix this?
Upvotes: 0
Views: 217
Reputation: 97148
Kotlin doesn't allow you to use assignments such as |=
as part of an expression. You need to split this into two expressions:
notifyDetailsFlags = notifyDetailsFlags or Notification.FLAG_AUTO_CANCEL
// the beginning of the call
.addFlags(notifyDetailsFlags)
Upvotes: 3