首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android - startForeground操作未显示

Android - startForeground操作未显示
EN

Stack Overflow用户
提问于 2013-10-16 10:32:11
回答 1查看 708关注 0票数 2

我目前正在尝试创建一个带有动作的foregroundNotification,但是动作+图标不会显示。

下面是我的代码:

代码语言:javascript
复制
        Intent intent = new Intent(KEY);
        PendingIntent nextIntent = PendingIntent.getBroadcast(this, 0, intent, 0);

        // Build the notification that tells the user that the service
        // is ongoing
        NotificationCompat.Builder foregroundNoteBuilder = new NotificationCompat.Builder(this)
                .setSmallIcon(....)
                .setContentTitle(....)
                .setContentText(....)
                .addAction(R.drawable.pause, "Pause all messages", nextIntent);

        Notification note = foregroundNoteBuilder.build();

        // Update the notification
        startForeground(1, note);

前台通知显示时没有该操作。有什么建议吗?谢谢。

编辑:显然,当通知托盘中存在任何其他通知时(例如,“使用GPS搜索...”、“作为媒体设备连接”等)。你知道为什么会发生这样的事情吗?

EN

回答 1

Stack Overflow用户

发布于 2014-01-31 06:31:19

操作未显示,因为通知可能未展开。通过用两个手指向下滑动/滚动来扩展它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19394307

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档