如何在Android应用程序通知数? [英] How to Create Number of notifications in android Application?

查看:131
本文介绍了如何在Android应用程序通知数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

海我想动态的创建数量的通知,我也能够创造出一个通知only.Am搜索,并得到回答在这个论坛<一个href="http://stackoverflow.com/questions/6224178/how-to-create-multiple-statusbar-notifications-in-android">How建立在Android的多状态栏通知,但这里的通知是mentiones.but我需要动态的多个通知取决于数量。

Hai i want to create number notification dynamically,i can able to create single notification only.Am searching and get answer in this forum How to create Multiple statusbar Notifications in android but here the notification is mentiones.but i need dynamic multiple notification depend on number.

假设我有一些= 1,我需要1的通知,如果数量= 2我需要2个通知,怎么办this.kindly指导我?看我的形象,如果有人不明白我的问题恳请我?

Suppose i have number=1 i need 1 notification,if number=2 i need 2 notification how to do this.kindly guide me?See my image if anybody dont understand my question kindly ask me?

推荐答案

上面的链接显示了如何发出通知:

The link above shows how to send a notification:

mNotificationManager.notify(ID,notifyDetails);

和设置id每次是不同的,例如,如果你想5的通知,你可以尝试这样的:

And set the id to be different each time, for instance if you want 5 notifications, you could try something like:

的for(int n = 0; ID小于5;身份证++){mNotificationManager.notify(ID,notifyDetails);}

这篇关于如何在Android应用程序通知数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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