I am trying to maintain databases synchronized between a Webservice and an Android application. The code below works, but I am facing some problems:
- Every time I go to the main page of the application, a new endless process starts.
- The process never ends.
Can someone explain how to start and stop this process as I want?
I want this process to run every 5 minutes, but only once and when the application is open.
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final Handler handler = new Handler(); final Runnable r = new Runnable() { public void run() {
source share