Android Notification.BigTextStyle behavior

旧城冷巷雨未停 提交于 2019-12-02 00:36:01

问题


I have observed the following behavior when I create a notification with

Notification.setContextText("Teaser text.  Read more...");
Notification.setStyle(new Notification.BigTextStyle().bigText("full text ..."));
  • When the notification appears at the top of the list (or is the only notification) I see the whole of "full text" wrapped onto multiple lines as required.
  • When there are other notifications above this one I see "Teaser text. Read more...".
  • If I leave out the BigTextStyle bit above and simply issue setContentText("full text...") the full text appears partially and does not wrap around.

Is this the expected behavior? Can it somehow be modified so as to always - i.e. when the notification is not at the top of the list - show the big text - or get ContentText to wrap? I'd be most obliged for any help and tips on this.


回答1:


What you are seeing is correct. Only the topmost notification is expanded by default, however the user can always expand any notification (through a two finger swipe down or one finger hold and swipe down). There's no way to programmatically always make your notification expanded or programmatically expand it.



来源:https://stackoverflow.com/questions/39751675/android-notification-bigtextstyle-behavior

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!