Code example for Chronometer

Methods: getText, setBase, start

0
	View.OnClickListener mStartListener = new OnClickListener() {
	    public void onClick(View v) { 
 
	      int stoppedMilliseconds = 0; 
 
	      String chronoText = mChronometer.getText().toString(); 
	      String array[] = chronoText.split(":"); 
	      if (array.length == 2) { 
	        stoppedMilliseconds = Integer.parseInt(array[0]) * 60 * 1000 
	            + Integer.parseInt(array[1]) * 1000; 
	      } else if (array.length == 3) { 
	        stoppedMilliseconds = Integer.parseInt(array[0]) * 60 * 60 * 1000  
	            + Integer.parseInt(array[1]) * 60 * 1000 
	            + Integer.parseInt(array[2]) * 1000; 
	      } 
 
	      mChronometer.setBase(SystemClock.elapsedRealtime() - stoppedMilliseconds); 
	      mChronometer.start(); 
	    } 
	  }; 
 
	View.OnClickListener mStopListener = new OnClickListener() {
	    public void onClick(View v) {