100 秒に 2 桁を超える数字を取得することを除いて、正常に動作するカウント ダウン タイマーがあります。私は 2 つのカレンダー オブジェクトを作成し、ミリ秒単位で時刻を取得し、それを減算しています。コード
long milsecs1= calendar1.getTimeInMillis();
long milsecs2 = calendar2.getTimeInMillis();
long diff = milsecs2 - milsecs1;
long dsecs = diff / 1000;
long ddays = diff / (24 * 60 * 60 * 1000);
diff=diff-ddays *(24 * 60 * 60 * 1000);
textDays.setText( Integer.toString( (int)ddays)+":" );
long dhours = diff / (60 * 60 * 1000);
diff=diff-dhours* (60 * 60 * 1000);
textHours.setText( Integer.toString( (int)dhours)+":" );
long dminutes = diff / (60 * 1000);
diff=diff-dminutes* (60 * 1000);
textMinuts.setText( Integer.toString( (int)dminutes)+":" );
/////////////////////////////////////////////////
// THIS IS THE PART THAT IS NOT WORKING, I WANT NUMBERS 0-99, BUT GETTING NUMBERS LIKE 230
long dseconds = diff / (100);
textSeconds.setText( Integer.toString( (int)dseconds)+":" );
diff=diff-dseconds;