해결책을 찾았습니다.
private long calculateElapsedTime(Chronometer mChronometer) {
long stoppedMilliseconds = 0;
String chronoText = mChronometer.getText().toString();
String array[] = chronoText.split(":");
if (array.length == 2) {
stoppedMilliseconds = Integer.parseInt(array[0]) * 60 * 1000
+ Integer.parseInt(array[1]) * 1000;
} else if (array.length == 3) {
stoppedMilliseconds = Integer.parseInt(array[0]) * 60 * 60 * 1000
+ Integer.parseInt(array[1]) * 60 * 1000
+ Integer.parseInt(array[2]) * 1000;
}
return stoppedMilliseconds;
}
을 그리고 부하 기능에서이 같은 크로노 미터 새로 고침 :
는 저장 기능에서 나는이 방법으로 값을 저장이 언젠가 누군가 도움이 될 것입니다
((GameActivity) activity).getcGameTime().setBase(
SystemClock.elapsedRealtime() - gameElapsedTime(getcGameTime()));
희망을. 건배!