is message") .setSmallIcon(R.drawable.ic_notification) .build() val nm = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager nm.notify(1, notification)
.setSummaryText("Big text summary") .bigText("This is long text. This is long text. This is long text. This is long text. This is long text.") val notification = NotificationCompat.Builder(context, CHANNEL_ID_NORMAL) .setContentTitle("This is title") .setContentText("This is message") .setTicker("This is ticker") // for legacy Android .setStyle(style) ... .build() val nm = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager nm.notify(1, notification)
.setSummaryText("Big text summary") .bigText("This is long text. This is long text. This is long text. This is long text. This is long text.") val notification = NotificationCompat.Builder(context, CHANNEL_ID_NORMAL) .setContentTitle("This is title") .setContentText("This is message") .setTicker("This is ticker") // for legacy Android .setStyle(style) ... .build() val nm = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager nm.notify(1, notification) StyleͷΠϯελϯε࡞
.setSummaryText("Big text summary") .bigText("This is long text. This is long text. This is long text. This is long text. This is long text.") val notification = NotificationCompat.Builder(context, CHANNEL_ID_NORMAL) .setContentTitle("This is title") .setContentText("This is message") .setTicker("This is ticker") // for legacy Android .setStyle(style) ... .build() val nm = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager nm.notify(1, notification)
"ී௨ͷνϟϯωϧ", NotificationManager.IMPORTANCE_DEFAULT) val channel2 = NotificationChannel(CHANNEL_ID_IMPORTANT, "ॏཁͳνϟϯω ϧ", NotificationManager.IMPORTANCE_HIGH) val nm = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager nm.createNotificationChannel(channel1) nm.createNotificationChannel(channel2) } API 26Ҏ߱ͷΈ࣮ߦ
is message") .setSmallIcon(R.drawable.ic_notification) .build() val nm = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager nm.notify(1, notification) νϟϯωϧIDΛࢦఆ