Reputation: 156
I have a chronometer and am using mChronometer.getText();
how do I convert this to an int? using Integer.parseInt();
throws an error because mChronometer.getText();
outputs in the form minutes : seconds
Upvotes: 4
Views: 6543
Reputation: 1077
if you are using android.widget.Chronometer
you can get the elapsed time with :
int elapsedMillis = (int) (SystemClock.elapsedRealtime() - mChronometer.getBase());
Upvotes: 11