Code example for Chronometer

Methods: getBasesetText

0
	@Override 
	public void onChronometerTick(Chronometer chrono) {
		// TODO Auto-generated method stub		 
		if(!paused)
		{ 
			long minutes=((SystemClock.elapsedRealtime()-chrono.getBase())/1000)/60;
			long seconds=((SystemClock.elapsedRealtime()-chrono.getBase())/1000)%60;
			currentTime=minutes+":"+seconds;
			chrono.setText(currentTime);
			elapsedTime=SystemClock.elapsedRealtime();
		} 
		else 
		{ 
			long minutes=((elapsedTime-chrono.getBase())/1000)/60;
			long seconds=((elapsedTime-chrono.getBase())/1000)%60;
			currentTime=minutes+":"+seconds;
			chrono.setText(currentTime);
			elapsedTime=elapsedTime+1000;
		} 
 
	} 
 
Experience pair programming with AI  Get Codota for Java