Code example for Ringtone

Methods: isPlaying, play

0
		SharedPreferences prefs;
		prefs=this.getSharedPreferences("CountdownTimerPrefs", 0);
		String fn=prefs.getString("alarm", "");
		if(fn!=""){
		  rt=RingtoneManager.getRingtone(this, Uri.parse(fn));
		  if(rt!=null&&!rt.isPlaying())rt.play();
		} 
		if(prefs.getBoolean("vibrator", true))
		  vib.vibrate(new long[]{0,1000,500,1000,500,1000}, -1);
		} 
 
	 
}