現在の時刻が表示された開始ボタンがあり、現在の時刻より 1 時間後の停止時刻のボタンを使用できるようにしたいと考えています。どうすればこれを行うことができますか?
現在の時刻を表示するボタンのコードは次のとおりです
Button stopButton = (Button) this
.findViewById(R.id.StartTrackingEditStopTime_button);
// using SimpleDateFormat class
SimpleDateFormat sdfStopTime = new SimpleDateFormat("hh:mm:ss a",
Locale.ENGLISH);
String newStoptime = sdfStopTime
.format(new Date(System.currentTimeMillis()));
stopButton.append(newStoptime);
これを行う方法についての助けやアドバイスをありがとう。