如何在通知中设置文本 [英] How to set Text in Notification

查看:46
本文介绍了如何在通知中设置文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置通知的此文本行.我用来模拟图像中内容的代码是 通知通知 = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.ic_launcher).setContentTitle("迈克尔").setContentText("今晚吃晚饭?").setSubText("我们去吃晚饭吧,你有空吗?").setLargeIcon(myBitMap).addAction(R.drawable.ic_archive, "ARCHIVE", null).addAction(R.drawable.ic_reply, "REPLY", null).build()

How can I set this text line of the notification. my code to simulate what is in the image is Notification notification = new NotificationCompat.Builder(context) .setSmallIcon(R.drawable.ic_launcher) .setContentTitle("Michael") .setContentText("Dinner tonight?") .setSubText("let's grab some dinner.Are you free?") .setLargeIcon(myBitMap) .addAction(R.drawable.ic_archive, "ARCHIVE", null) .addAction(R.drawable.ic_reply, "REPLY", null) .build()

编辑

还是不行,我必须使用自定义视图?

or no way , I've to use custom view ?

推荐答案

感谢 Eugen Pechanec

答案在那个链接里https://developer.android.com/reference/android/support/v4/app/NotificationCompat.InboxStyle.html

这篇关于如何在通知中设置文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆