0

Possible Duplicate:
AlarmManager - How to repeat an alarm at the top of every hour?

Can someone please guide me how we can set multiple AlarmManager in android.

I want to run rest api using the AlamManager services.

I have two time to run repeating services. first aftrer every two mins. Second end of the(eg 12.00).

How we can set the MutlialarmManager service.

Community
  • 1
  • 1
Singh
  • 151
  • 1
  • 12
  • To set several alarms on different time with different repeat intervals - is that what you want? – Andrey Ermakov Jun 13 '12 at 14:34
  • Please refer [this](http://stackoverflow.com/questions/6012563/android-how-to-repeat-a-service-with-alarmmanager-every-15-minutes-but-only-ru) question for a way to do it. – Andrey Ermakov Jun 14 '12 at 12:26

1 Answers1

1

This example is an update for each 10 sec. So u have to adapt it to your work.

new Thread(){
@Override
public void run(){
   autoUpdate = new Timer();
   autoUpdate.schedule(new TimerTask() {
      @Override
      public void run() {
           runOnUiThread(new Runnable() {
              public void run() {
                  // TODO
              }
           });
      }
    },0,10000);//updates each 10 sec.
 }
 }.start();

Hope this will help.

13KZ
  • 1,295
  • 5
  • 24
  • 43