I am working on Bubbles in Android 11 and some functions doesn't work
I don't know how to fix this.
Android Studio writes:
Unresolved reference: setShortcutInfo
My NotificationCompat.Builder:
val builder = NotificationCompat.Builder(
appContext,
CHANNEL_WHATEVER
)
.setSmallIcon(R.drawable.ic_launcher_foreground)
.setContentTitle("Um, hi!")
.setShortcutId("Settings")
.setShortcutInfo(shortcutInfo)
.setBubbleMetadata(bubble)
And my ShortcutInfoCompat.Builder:
val shortcutInfo = ShortcutInfoCompat.Builder(this, SHORTCUT_ID)
.setLongLived(true)
.setShortLabel("Settings")
.setIntent(Intent(Settings.ACTION_SETTINGS))
.setIcon(IconCompat.createWithResource(this, R.drawable.ic_launcher_foreground))
.build()
ShortCutManagerCompat with pushdynamicshortcut returns:
Unresolved reference: pushDynamicShortcut
I Copy/Pasted code from this: Gitlab
Thanks.