프로그래밍/android2013. 6. 12. 08:48
 
try
{
	Uri kRingtoneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
	final MediaPlayer kPlayer = new MediaPlayer();
	kPlayer.setDataSource($context, kRingtoneUri);
	kPlayer.prepare();
	kPlayer.setLooping(false);
	kPlayer.start();

	kPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener()
	{
		@Override
		public void onCompletion(MediaPlayer mp)
		{
			kPlayer.stop();
			kPlayer.release();
			invokeCallback($target, $method);
		}
	});
} catch (Exception e)
{

}
Posted by 쎄미

댓글을 달아 주세요