开发者

How to differentiate between Mulitple alarms in android

开发者 https://www.devze.com 2023-01-21 11:31 出处:网络
In the Android app which is getting developed开发者_开发问答, i have multiple alarms. I want to initiate, different actions on different alarms.

In the Android app which is getting developed开发者_开发问答, i have multiple alarms.

I want to initiate, different actions on different alarms.

How can i differentiate or determine , exactly which alarm has been fired??

Rgds Yaaga


When you set your alarms with AlarmManager you give each of them a PendingIntent which must be bound to an Intent. You can use that Intents' extras bundle to distinguish between different alarms (by putting in an int or a String, say).

0

精彩评论

暂无评论...
验证码 换一张
取 消