0
In my application I inserted a Chronometer that simulates a playing time... but when I click stop and then continue it shows me in format (00:00:00:00) and wanted to show me again at (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...
Good morning friend... it would not be a Textview will own the Chronometer property... even if I paste this code it presents me the error in getInstance() and the watchTextView switched to watchmaking.setText(...)
– Nathan