0
저는 신선한 안드로이드 프로그래밍과 countdowtimer를 찾으려고합니다. 내 간단한 퀴즈 게임의 포인트를 결정하기 때문에 정수로 끝내는 데 몇 초가 걸릴지 알아야합니다. 나는 많은 노력을했지만 정확한 해결책을 얻지 못했습니다. 아무도 나를 도울 수 있습니까?android는 countdowntimer에서 int로 시간을 얻습니다.
저는 신선한 안드로이드 프로그래밍과 countdowtimer를 찾으려고합니다. 내 간단한 퀴즈 게임의 포인트를 결정하기 때문에 정수로 끝내는 데 몇 초가 걸릴지 알아야합니다. 나는 많은 노력을했지만 정확한 해결책을 얻지 못했습니다. 아무도 나를 도울 수 있습니까?android는 countdowntimer에서 int로 시간을 얻습니다.
이 시도 : ----
추가 정보를 위해TextView textic = (TextView) findViewById(R.id.textView2);
CountDownTimer count = new CountDownTimer(30000, 1000) {
public void onTick(long millisUntilFinished) {
textic.setText("Seconds remaining: " + millisUntilFinished/1000);
}
public void onFinish() {
textic.setText("Finished");
}
};
count.start();
에서 봐보십시오이 방법
CountDownTimer count = new CountDownTimer(1000000, 1000) {
public void onTick(long millisUntilFinished) {
int seconds = (int) (millisUntilFinished/1000) % 60;
int minutes = (int) ((millisUntilFinished/(1000 * 60)) % 60);
int hours = (int) (((millisUntilFinished/(1000 * 60)) % 60))%60;
textic.setText(hours +":"+minutes+":"+seconds);
}
public void onFinish() {
textic.setText("Finished");
}
};
count.start();
을 내가 표시 한 사실이 얼마나 많은 거기 초 만 나는 그것을 점수를 위해 정수로 만들려고 노력하고있다. 예를 들어, 사용자가 5 초 후에 5 포인트를 얻으면 종료됩니다. score = score + xx 그러나 xx 대신 무엇을 써야합니까? – user3797465