Here is the simple example of using timer in Android public void startTimer() { timer = new Timer(); TimerTask timerTask = new TimerTask() { @Override public void run() { runOnUiThread(new Runnable() { @Override public void run() { textView.setText(String.format(Locale.getDefault(), "%d", time)); if (time > 0) time -= 1; else { textView.setText(R.string.hello_world); btnStart.setChecked(false); } } }); } }; timer.scheduleAtFixedRate(timerTask, 0, 1000); } Full class MainActivity.java package com.guna.testapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.CompoundButton; import android.widget.TextView; import android.widget.ToggleButton; import j...
A plat with simple tutorial for native android developers.