Code example for Chronometer

Methods: getText, setBase, start

0
        			status.setText("Paused!"); 
        		}else{ 
        			elapsedMilliSeconds =0; 
        			recordButton.setText("Pause"); 
        			paused = false; 
        			time = timeChronometer.getText().toString(); 
        			String[] array = time.split(":"); 
        			if(array.length == 2){   
        				//00:00 
        				elapsedMilliSeconds = Integer.parseInt(array[0])*60*1000 + Integer.parseInt(array[1])*1000; 
        			} else if(array.length == 3){ 
        				// 00:00:00 
        				elapsedMilliSeconds = Integer.parseInt(array[0])*60*60*1000 +Integer.parseInt(array[1])*60*1000 + Integer.parseInt(array[2])*1000; 
        			} 
        			timeChronometer.setBase(SystemClock.elapsedRealtime()-elapsedMilliSeconds); 
        			timeChronometer.start(); 
        			status.setText("Recording!"); 
        		} 
        	} 
        }}; 
    //Stop onClick listener