android.media.RingtoneManager.getRingtonePosition()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中android.media.RingtoneManager.getRingtonePosition方法的一些代码示例,展示了RingtoneManager.getRingtonePosition的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RingtoneManager.getRingtonePosition方法的具体详情如下:
包路径:android.media.RingtoneManager
类名称:RingtoneManager
方法名:getRingtonePosition

RingtoneManager.getRingtonePosition介绍

暂无

代码示例

代码示例来源:origin: ywwynm/EverythingDone

private static boolean isFileRingtone(RingtoneManager ringtoneManager, Uri uri) {
  return uri != RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
      && ringtoneManager.getRingtonePosition(uri) == -1;
}

代码示例来源:origin: stackoverflow.com

RingtoneManager rm = new RingtoneManager(context);
 Random random = new Random();
 int i = rm.getRingtonePosition(RingtoneManager
     .getActualDefaultRingtoneUri(context,
         RingtoneManager.TYPE_RINGTONE));
 MyApplication.APPLICATION_SHARED_PREFERENCE.edit()
     .putInt(MyConstants.PHONE_RINGTONE_NUMBER, i).commit();
 int chanegToneNumber;
 Cursor cursor = rm.getCursor();
 while (true) {
   chanegToneNumber = random.nextInt(cursor.getCount());
   if (chanegToneNumber != i)
     break;
 }
 Log.d(TAG, "Tone: " + i);
 Log.d(TAG, "Tone total: " + cursor.getCount());
 while (cursor.moveToNext()) {
   if (i == cursor.getInt(cursor
       .getColumnIndex(MediaStore.MediaColumns._ID))) {
     RingtoneManager.setActualDefaultRingtoneUri(context,
         RingtoneManager.TYPE_RINGTONE,
         rm.getRingtoneUri(chanegToneNumber));
     break;
   }
 }

代码示例来源:origin: ywwynm/EverythingDone

} else {
  Uri uri = Uri.parse(Uri.decode(uriStr));
  if (uri != defaultUri && rm.getRingtonePosition(uri) == -1) { // user's ringtone
    String pathName = UriPathConverter.getLocalPathName(context, uri);
    if (pathName == null || !new File(pathName).exists()) {

代码示例来源:origin: ywwynm/EverythingDone

if (manager.getRingtonePosition(uri) != -1) continue;

代码示例来源:origin: consp1racy/android-support-preference

mClickedPos = getListPosition(mRingtoneManager.getRingtonePosition(mExistingUri));

相关文章