Code example for Ringtone

Methods: isPlaying, play

0
					if (System.currentTimeMillis() > stopTime || stopRingtone) {
						ringtone.stop();
						Ring.this.finish();
						return; 
					} 
					if (!ringtone.isPlaying())
						ringtone.play();
					handler.postDelayed(this, 100);
					 
				} 
			}; 
			handler.postDelayed(r, 100);
			ringtone.play();
		} 
	} 
	 
	@Override 
	protected void onPause() { 
		super.onPause(); 
		allDone(); 
	}