我正在使用 Android 11 中的 Bubbles,但某些功能不起作用
我不知道如何解决这个问题。
Android Studio 写道:
Unresolved reference: setShortcutInfo
我的 NotificationCompat.Builder:
val builder = NotificationCompat.Builder(
appContext,
CHANNEL_WHATEVER
)
.setSmallIcon(R.drawable.ic_launcher_foreground)
.setContentTitle("Um, hi!")
.setShortcutId("Settings")
.setShortcutInfo(shortcutInfo)
.setBubbleMetadata(bubble)
还有我的 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 与 pushdynamicshortcut 返回:
Unresolved reference: pushDynamicShortcut
我从这里复制/粘贴代码: Gitlab
谢谢。