gpt4 book ai didi

android - 在通知中显示一个持续的进度条,android?

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:04:16 25 4
gpt4 key购买 nike

我试图在通知窗口中显示不确定的进度条。但它没有显示。

这是我的代码

                    int id = 1;
NotificationManager mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Builder mBuilder = new NotificationCompat.Builder(
MenuActivity.this);
mBuilder.setContentTitle("My app")
.setContentText("Download in progress");
mBuilder.setProgress(0, 0, true);
// Issues the notification
mNotifyManager.notify(id, mBuilder.build());

我正在关注这个链接 Continuing Activity Indicator

谁能告诉我哪里出了问题?

最佳答案

解决了只需要加一个图标

.setSmallIcon(R.drawable.ic_notification);

关于android - 在通知中显示一个持续的进度条,android?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28693079/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com