Android - doing backgroud work every few minutes -



Android - doing backgroud work every few minutes -

i need write application background work every few minutes. question how can start work service. need create using threads , calculating time using scheme utils or maybe there improve solution?

you can utilize handler , postdelayed method:

handler handler = new handler(looper.getmainlooper()); handler.postdelayed(new runnable() public void run() { // work } }, minutes * 60 * 1000);

if interval sufficiently long can consider using alarmmanager.

android android-service

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -