I'm trying to notify simple notification as in Java code
what is the syntax for this line in kotlin?
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_ONE_SHOT | Intent.FLAG_ACTIVITY_NEW_TASK);
in kotlin, I can't use '|' for 2 flags, only like this:
stackBuilder.getPendingIntent(0,PendingIntent.FLAG_ONE_SHOT)
You can find the available bitwise operations in the official docs here. These are all infix functions that are spelled out in Kotlin instead of using special symbols.
In your case, you can do the following:
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_ONE_SHOT or Intent.FLAG_ACTIVITY_NEW_TASK);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With