0

AlarmManager repeats endress

view story
linux-howto

http://stackoverflow.com – there is 3 classes. service class,executing class, receiver class fisrt, service class execute Amethod in "executing class" the code in"executing class" is Amethod(){ Intent intent = new Intent(); intent.setAction("MY_ACTION"); PendingIntent pi = PendingIntent.getBroadcast( context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT ); AlarmManager am = (AlarmManager)context.getSystemService( Context.ALARM_SERVICE ); am.cancel(pi); if(true){//to repaet every 10 sec. am.set( AlarmManager.RTC_WAKEUP,10000, pi ); } } (HowTos)