@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Sync sync = new Sync(call,60*1000);
}
final private Runnable call = new Runnable() {
public void run() {
//This is where my sync code will be, but for testing purposes I only have a Log statement
Log.v("test","this will run every minute");
handler.postDelayed(call,60*1000);
}
};
public final Handler handler = new Handler();
public class Sync {
Runnable task;
public Sync(Runnable task, long time) {
this.task = task;
handler.removeCallbacks(task);
handler.postDelayed(task, time);
}
}
}
Saturday, 1 December 2012
Method to execute at regular interval of times
Subscribe to:
Post Comments (Atom)
Pass a HashMap from Angular Client to Spring boot API
This example is for the case where fileData is very huge and in json format let map = new Map<string, string>() map.set(this.ge...
-
package com.example.spinnerhint; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.app.Activi...
-
I faced this issue while implementing custom image button , here in xml following attribute is not supported android:background="?...
-
best link for android timers http://www.fampennings.nl/maarten/android/04timers/index.htm orientation best link Orientation Change h...
No comments:
Post a Comment