Android通知:在应用名称之后添加文本,之后再添加

Kei*_*ozi 7 notifications android

有没有人知道我们如何在通知中和时间戳(何时)之前添加文本,在应用程序名称的右侧? 预习

Nuw*_*tta 9

Notification.Builder中有一个名为setSubText()的方法.

您可以传递消息以显示为String.

链接到文档:https://developer.android.com/reference/android/app/Notification.Builder.html#setSubText(java.lang.CharSequence)

Notification noti = new Notification.Builder(mContext)
     .setContentTitle(AppName)
     .setContentText(message)
     .setSmallIcon(R.drawable.logo)
     .setSubText(senders_mail)
     .build();
Run Code Online (Sandbox Code Playgroud)