【发布时间】:2021-12-21 19:26:11
【问题描述】:
我的故事是像这样在图标或徽章编号顶部制作数字 home screen icon 但它不适用于所有设备,为什么? 以及如何解决?
【问题讨论】:
-
这不是 Android 功能。个别启动器应用可以选择支持它。
标签: android kotlin numbers badge
我的故事是像这样在图标或徽章编号顶部制作数字 home screen icon 但它不适用于所有设备,为什么? 以及如何解决?
【问题讨论】:
标签: android kotlin numbers badge
如果通知通知android系统为您的应用程序图标添加徽章, 您可以使用以下代码显示通知
val id = "my_channel_01"
val name = getString(R.string.channel_name)
val descriptionText = getString(R.string.channel_description)
val importance = NotificationManager.IMPORTANCE_LOW
val mChannel = NotificationChannel(id, name, importance).apply {
description = descriptionText
setShowBadge(true)
}
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(mChannel)
【讨论】: