PersonalHealth
PersonalHealth

Reputation: 45

Set alarmManager not to repeat

Is there anything about, setting alarmmanager activate only ones?

setRepeating ();

How to set this activate only ones?

Upvotes: 0

Views: 178

Answers (2)

Da2da2
Da2da2

Reputation: 69

if you want to activate the AlarmManager only once, you should use:

set(int type, long triggerAtMillis, PendingIntent operation);

instead of:

setRepeating(int type, long triggerAtMillis, 
    long intervalMillis, PendingIntent operation);

Upvotes: 0

Karun Shrestha
Karun Shrestha

Reputation: 733

If you don't want the alarm to repeat, don't include the code

setRepeating();

Upvotes: 3

Related Questions