android状态栏显示通知图标,android – 在通知栏中显示小图标但隐藏在通知面板中...

博主正在寻找一种方法,只在Android通知面板中显示前两个大图标,而不会从通知栏中移除它们。提供的代码片段展示了如何创建一个包含大图标的Notification,但未能实现只显示部分图标的特定需求。问题在于隐藏通知也会导致大图标的消失。
摘要由CSDN通过智能技术生成

我试着在这个论坛找到这个,我发现了一对,但没有人为我工作.我只需要将它隐藏在大图标旁边的通知面板中,但是如果我隐藏它,它也会从通知栏中消失.

51d67f17cee4b090642abc457317db1e.png

有没有办法只显示第一个和第四个通知中发生的大图标?

这是我正在使用的代码:

mNotificationManager = (NotificationManager)

this.getSystemService(Context.NOTIFICATION_SERVICE);

Intent intent;

Notification.Builder mBuilder =

new Notification.Builder(this)

.setSmallIcon(R.mipmap.small_icon).setTicker(getApplicationContext().getResources().getString(R.string.app_name))

.setLargeIcon(largeIcon)

.setAutoCancel(true)

.setVibrate(new long[]{1000, 1000, 1000, 1000, 1000})

.setLights(Color.GREEN, 1000, 1000)

.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))

.setContentTitle(extras.getString("title"))

.setStyle(new Notification.BigTextStyle().bigText(extras.getString("message")))

.setContentText(extras.getString("message"));

edit.putString(Config.FRAGMENT, extras.getString("fragment"));

edit.commit();

intent = new Intent(this, NavigationActivity.class);

PendingIntent contentIntent = PendingIntent.getActivity(this, 0,

intent, 0);

mBuilder.setContentIntent(contentIntent);

mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值