解决方法 :
在记录开始的 System.currentTimeMillis(); 方法中设置 start_time 方法。
然后使用 Runnable 可以执行一个循环,直到停止记录。
final Handler handler = new Handler();
Runnable update_runnable = new Runnable() {
public void run() {
updateTextView();
}
};
Then with the updateTextView() you'd do something like this:
long duration = (int) ((System.currentTimeMillis() - start_time) / 1000);
// ... set TextView with duration value
handler.postDelayed(update_runnable, 1000); /