How to display multiple notifications in android

前端 未结 18 1350
既然无缘
既然无缘 2020-11-29 19:39

I am receiving only one notification and if there comes another notification, it replaces the previous one and here is my code

private static void generateNo         


        
18条回答
  •  遥遥无期
    2020-11-29 20:18

    Another way of doing it is take the current date convert it into long just take the last 4 digits. There is a high probability that the number will be unique.

        long time = new Date().getTime();
        String tmpStr = String.valueOf(time);
        String last4Str = tmpStr.substring(tmpStr.length() -5);
        int notificationId = Integer.valueOf(last4Str);
    

提交回复
热议问题