In my application I inserted a chronometer that simulates a game time ... but when I click on stop and then continue it shows me in format (00: 00: 00: 00) and wanted to show me again in ( 00:00)
NOTE: show me in milliseconds
code:
private Chronometer reloginho;
long tempoPausado = 0;
imgButton_play.setEnabled(true);
imgButton_pause.setEnabled(false);
imgButton_1.setEnabled(false);
imgButton_2.setEnabled(false);
imgButton_play.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
imgButton_play.setEnabled(false);
imgButton_pause.setEnabled(true);
imgButton_1.setEnabled(true);
imgButton_2.setEnabled(true);
reloginho.setBase(SystemClock.elapsedRealtime());
reloginho.start();
reloginho.setBase(SystemClock.elapsedRealtime() + tempoPausado);
}
});
imgButton_pause.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
imgButton_play.setEnabled(true);
imgButton_pause.setEnabled(false);
imgButton_1.setEnabled(false);
imgButton_2.setEnabled(false);
tempoPausado = reloginho.getBase();
SystemClock.elapsedRealtime();
reloginho.stop();
}
});
Thank you ...