Wie implementiere ich CountDownTimer Class in Xamarin C # Android? [geschlossen]
Ich bin neu in Xamarin.Android Framework. Ich arbeite am Countdown-Timer, kann ihn aber nicht wie den implementierenJavaCountDownTimer
Klasse. Könnte mir bitte jemand helfen, folgendes Java zu konvertieren?Code zu C # Xamarin Android-Code.
bar = (ProgressBar) findViewById(R.id.progress);
bar.setProgress(total);
int twoMin = 2 * 60 * 1000; // 2 minutes in milli seconds
/** CountDownTimer starts with 2 minutes and every onTick is 1 second */
cdt = new CountDownTimer(twoMin, 1000) {
public void onTick(long millisUntilFinished) {
total = (int) ((dTotal / 120) * 100);
bar.setProgress(total);
}
public void onFinish() {
// DO something when 2 minutes is up
}
}.start();