android - 显示默认展开的 android 通知操作按钮

标签 android notifications android-notifications notification-action

有没有办法在默认展开的通知中显示操作按钮? 我使用持续通知来控制我的应用程序中的培训过程。我希望在通知区域出现通知后立即显示“停止”和“暂停”等控制按钮。

Collapsed buttons by default

Want the buttons to be expanded

最佳答案

您无法展开通知。唯一的解决办法是,设置 Priority Max,然后在通知列表的顶部展开。这也取决于设备。

mBuilder.setPriority(Notification.PRIORITY_HIGH)

关于android - 显示默认展开的 android 通知操作按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47324575/

相关文章:

android - android 设备无法接收 google play 游戏通知的可能原因?

java - 引用 ImageView 子类获取 ClassCastException

Android - 如何从小部件启动 Activity 并返回主屏幕

android - 如何在我的应用程序关闭之前一直显示我的 Android 通知?

android - 在 Firebase 推送通知中添加翻译

java - Forerground 服务初始化后无法更新通知文本;上下文问题

android - 使用 MyLocationOverlay 绘制精度圆

android - 如何使用 gradle 在 IntelliJ IDEA 13 中添加 google play 服务

安卓通知: GCM or Service

android - 如何获取Android中所有应用程序收到的通知数