Intent intent = new Intent(this, TimeAlarm.class);
  PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0,intent,
PendingIntent.FLAG_ONE_SHOT);

  am.set(AlarmManager.RTC_WAKEUP,System.currentTimeMillis() + (1 * 1000),
pendingIntent);

TimeAlarm.class is insame life as other classs

 am.set(AlarmManager.RTC_WAKEUP,System.currentTimeMillis() + (1 * 1000),
pendingIntent);
this line giving me error=null

RK


On Thu, Jul 5, 2012 at 6:34 PM, skink <[email protected]> wrote:

>
>
> Rahul Kaushik wrote:
> > Hi,
> >
> > Can anyone pls tell me the best way to call an method after every 5 min
> > (handler,timer),i googled and found handler.postdeleyd doesnt not
> guarntee
> > to execute,timer hangs some time ,pls suggest me the way to call method
> > after every 5 minutes
> > Code snippet will be very useful
> >
> > Thanks
>
>
> don't use any handlers, timers or timertasks, use AlarmManager instead
>
> pskink
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to