如何在Android O的系统设置中对通知渠道进行排序 [英] How to sort notification channels in system settings on android O

查看:139
本文介绍了如何在Android O的系统设置中对通知渠道进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有预设的通知渠道顺序,可以更改.如何更改通知渠道的顺序?我尝试按channel_id和channel_name进行排序,但这是行不通的.

I have preset order of notification channels, that can be change. How to change order of notification channels? I try to sort by channel_id and channel_name, but it is not work.

推荐答案

我的解决方案中有错误.我尝试在频道ID的开头添加频道数以进行排序.所以我有这个:

There was error in my solution. I try to add number of channel on start of channel id for sorting. So i had this:

56_server_channel_id
78_server_channel_id
155_server_channel_id
9998_default_app_channel_id
9999_default_app_channel_id

但是由于缺少前导零,所以排序不符合我的预期.因此,正确的解决方案是:

But because of missing leading zeros, it sorted not as i expected. So, right solution is:

0056_server_channel_id
0078_server_channel_id
0155_server_channel_id
9998_default_app_channel_id
9999_default_app_channel_id

这篇关于如何在Android O的系统设置中对通知渠道进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆