I am trying to add a notification. I am following this: https://developer.android.com/training/notify-user/build-notification .
I have implemented this
implementation 'androidx.core:core-ktx:1.7.0' in gradle and this in my fragment
var builder = NotificationCompat.Builder(this, CHANNEL_ID) .setSmallIcon(R.drawable.notification_icon) .setContentTitle("Test") .setContentText("TestContent") .setPriority(NotificationCompat.PRIORITY_DEFAULT)
Builder is always red and it says “Unresolved reference: Builder”.
Maybe someone has an idea.