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
Post a Comment