How can i do a notification in the status bar without the expanded message in the “Notifications” window? (only want the icon)

做~自己de王妃 提交于 2019-12-12 15:39:32

问题


How can i do a notification in the status bar but without the expanded message in the "Notifications" window?

i mean, i need just the icon, nothing more

there is a way to do that?


回答1:


Quoting the documentation:

A status bar notification requires all of the following:

  • An icon for the status bar
  • A title and expanded message for the expanded view (unless you define a custom expanded view)
  • A PendingIntent, to be fired when the notification is selected

Hence, you will need to have an entry in the notification drawer. Among other reasons, this is so the user has some idea what the heck your icon is there for. Remember that the goal of Android development is to make users happy. Having unexplained icons in the status bar will not make the users happy.



来源:https://stackoverflow.com/questions/3973862/how-can-i-do-a-notification-in-the-status-bar-without-the-expanded-message-in-th

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