//RingtoneManager.TYPE_NOTIFICATION;   通知声音

//RingtoneManager.TYPE_ALARM;  警告

//RingtoneManager.TYPE_RINGTONE; 铃声

 
  
  1. /** 
  2.  * 获取的是铃声的Uri 
  3.  * @param ctx 
  4.  * @param type 
  5.  * @return 
  6.  */ 
  7. public static Uri getDefaultRingtoneUri(Context ctx,int type) { 
  8.  
  9.     return RingtoneManager.getActualDefaultRingtoneUri(ctx, type); 
  10.  
  11.  
  12. /** 
  13.  * 获取的是铃声相应的Ringtone 
  14.  * @param ctx 
  15.  * @param type 
  16.  */ 
  17. public Ringtone getDefaultRingtone(Context ctx,int type) { 
  18.  
  19.     return RingtoneManager.getRingtone(ctx, 
  20.             RingtoneManager.getActualDefaultRingtoneUri(ctx, type)); 
  21.  
  22.  
  23. /** 
  24.  * 播放铃声 
  25.  * @param ctx 
  26.  * @param type 
  27.  */ 
  28.  
  29. public static void PlayRingTone(Context ctx,int type){ 
  30.     MediaPlayer mMediaPlayer = MediaPlayer.create(ctx, 
  31.             getDefaultRingtoneUri(ctx,type)); 
  32.     mMediaPlayer.setLooping(true); 
  33.     mMediaPlayer.start(); 
  34.