Code example for Lock

Methods: tryLockunlock

0
			} 
		}; 
	} 
 
	public void updateUI() { 
		if (lock.tryLock()){
			mTextViewLight.setText("X: " + xValue);	
			mTextViewLight1.setText("Y: " + yValue);
			mTextViewLight2.setText("Z: " + zValue);
			lock.unlock();
		} 
 
	} 
 
	public void playSound(Uri path){
		if (mp.isPlaying()) {
			return; 
		} 
		mp.reset();
		try { 
Stop searching for code, let great code find you!  Add Codota to your java IDE