new Timer().schedule(new TimerTask() {
int i = 0;
@Override
public void run() {
runOnUiThread(new Runnable() {
public void run() {
showTestToast(String.valueOf(i++));
}
});
}
}, 0, 1000);
Toast toast;
public void showTestToast(String s) {
if (toast == null) {
toast = Toast.makeText(getApplicationContext(), s, 0);
} else {
toast.setText(s);
}
toast.show();
}