我已经尝试过\n
,但它仍然有效,但它不起作用。贝娄是我的代码:
val channelId = resources.getString("NotificationChannelID")
createNotificationChannel("NotifactionChannelName", channelId)
val pendingIntent: PendingIntent =
Intent(this, MainActivity::class.java).let { notificationIntent ->
PendingIntent.getActivity(this, 0, notificationIntent, 0)
}
val notification = Notification.Builder(this, channelId)
.setContentText("First Line \n Second Line \n")
.setSmallIcon(R.drawable.notification_icon)
.setContentIntent(pendingIntent)
.build()
startForeground(NOTIFICATION_MANAGER_NOTIFICATION_ID, notification)
for(e in error.iterator())
{
Log.d("Errors: ", "$e")
}