Code example for RingtoneManager

Methods: getRingtone, stopPreviousRingtone

0
 
		@Override 
		public void onReceive(Context context, Intent intent) { 
			if (intent.getAction().equals(subscription)) { 
				byte[] payload = intent.getByteArrayExtra(subscription + ".payload"); 
				mRingtoneManager.stopPreviousRingtone(); 
				mRingtoneManager.getRingtone(payload[0]).play(); 
			} 
		} 
	}; 
}