这在onCreate()
scheduleTaskExecutor.scheduleAtFixedRate(new Runnable() {
public void run() {
Calculate_Run();
runOnUiThread(new Runnable() {
public void run() {
tv_inseconds.setText(timer_seconds);
tv_inminutes.setText(timer_minutes);
}
});
}
}, 0, 1, TimeUnit.SECONDS);
如何从函数中调用它?我想在用户按下按钮时启动此线程。