public Runnable updateTimerThread = new Runnable() {
public void run() {
timeInMilliseconds = SystemClock.uptimeMillis() - startTime;
updatedTime = timeSwapBuff + timeInMilliseconds;
int secs = (int) (updatedTime / 1000);
int mins = secs / 60;
int hours = mins / 60;
secs = secs % 60;
// int milliseconds = (int) (updatedTime % 1000);
timerValue.setText("" + String.format("%02d", hours) + ":" +
"" + String.format("%02d", mins) + ":"
+ String.format("%02d", secs));
customHandler.postDelayed(this, 0);
}
};
//pauseButton
pauseButton = (Button) findViewById(R.id.pauseButton);
pauseButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
timeSwapBuff += timeInMilliseconds;
customHandler.removeCallbacks(updateTimerThread);
}
TimerActivity.java에서 타이머 구현 부분과 일시정지 버튼 클릭 시의 코드입니다.
밑에 일시정지된 부분에서 저장된 시, 분 ,초, 데이터를 MsgActivity.java로 넘기고 싶은데요
어떤식으로 넘겨야 할지 감이 안잡힙니다..
customhandler를 이용해서 넘기면 될지..ㅠ.ㅠ 조언좀 해주세요