2

When I call chronometer.start(), the chronometer starts counting but the base value (00:00) is still there and it is not overwritten.

chronometer in my xml file looks like this

<Chronometer
 android:id="@+id/chronometer"
 android:layout_width="100dp"
 android:layout_height="50dp"/>

and code in my Activity looks like this

 chronometer.setBase(SystemClock.elapsedRealtime());
 chronometer.start();

and the result looks like this

chronometer

Did anyone face the same problem ?

bezdyjoe
  • 63
  • 1
  • 5

1 Answers1

1

Only thing you need to do is to initialize chronometr first:

chronometer = view.findViewById(R.id.chronometer); chronometer.setText("");

and then you can start your chronometr without overwriting

chronometer.start();
Rezor
  • 126
  • 1
  • 3