private fun getNotificationBuilder(): NotificationCompat.Builder {
// this intent opens the MainActivity when the user taps on the notification
val intentNotification = Intent(context, MainActivity::class.java)
val pendingIntentNotification = PendingIntent.getActivity(
context,
exampleNotificationID,
intentNotification,
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
)
val myBitmap = BitmapFactory.decodeResource(
context.resources,
R.drawable.puppy
)
val builder = NotificationCompat.Builder(context.applicationContext, exampleChannelID)
.setSmallIcon(R.drawable.chair)
.setContentIntent(pendingIntentNotification)
.setLargeIcon(myBitmap)
.setStyle(NotificationCompat.BigPictureStyle()
.bigPicture(myBitmap)
.bigLargeIcon(null)
)
return builder
}
Я пытаюсь отобразить в уведомлении большое изображение. Я следую документам. Но в IDE отображается ошибка: [img]https://i.sstatic.net/uqzCK.jpg[/img] < /p> Это мой код: [code]private fun getNotificationBuilder(): NotificationCompat.Builder { // this intent opens the MainActivity when the user taps on the notification val intentNotification = Intent(context, MainActivity::class.java) val pendingIntentNotification = PendingIntent.getActivity( context, exampleNotificationID, intentNotification, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT )
val myBitmap = BitmapFactory.decodeResource( context.resources, R.drawable.puppy )
Я недавно начал изучать разработку приложений в Android Studio и Kotlin, поэтому я новичок, но учусь быстро. Однако я наткнулся на эту ошибку: «Неоднозначность разрешения перегрузки. Все эти функции совпадают». У меня есть только один файл...
What could be the problem here: enter image description here
I keep getting an error: Overload resolution ambiguity. All these functions match. public fun Text(text: String, modifier: Modifier = ..., color: Color = ..., fontSize: TextUnit = ...,...
Что может быть проблемой здесь:
Введите описание изображения здесь
Я продолжаю получать ошибку: неоднозначность разрешения перегрузки. Все эти функции совпадают.
Public Fun Text (текст: строка, модификатор: modifier = ..., color: color = ...,...
Я получаю сообщение об ошибке неоднозначности в моем Text Composable, и, похоже, этой проблемы нет никакого решения. Я получаю сообщение об ошибке только при использовании Text Composables.
@Composable
fun Add(navController: NavController) {
val...