About Timer and Action...Help!!----(Android App) -


there problem! want action after second change words after 5 second.i set besides setting of timer.

i think easy pick android 3 days. should do?

use alarmmanager repeating actions.

example:

pendingintent pintent = pendingintent.getservice(context, 0, new intent(context, yourintenthere.class), 0); alarmmanager alarm = (alarmmanager) context.getsystemservice(context.alarm_service); alarm.cancel(pintent); alarm.setrepeating(alarmmanager.rtc, calendar.getinstance().gettimeinmillis(), iinterval, pintent); 

so encapsulate logic want repeat in wich capable intent (activity or service).

alternatively use asynctask sleep, not recommend sth that.

see also:

http://developer.android.com/reference/android/app/alarmmanager.html http://www.techrepublic.com/blog/android-app-builder/use-androids-alarmmanager-to-schedule-an-event/


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -