Delete Ring tone from android list
I done a program to change ring tone of android. The main code is here
k = new File(txtRTC.getText().toString());
toneName=k.getName().split(".");
ContentValues values = new ContentValues();
//nameTone=nameTone("");
values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());
values.put(MediaStore.MediaColumns.TITLE,k.getName());
values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/mpeg");
values.put(MediaStore.Audio.Media.ARTIST, "Some Artist");
values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values.put(MediaStore.Audio.Media.IS_NOTIFICATION, false);
values.put(MediaStore.Audio.Media.IS_ALARM, false);
values.put(MediaStore.Audio.Media.IS_MUSIC, false);
//Insert it into the database
uri = MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath());
getContentResolver().delete(uri, MediaStore.MediaColumns.DATA + "=\"" + k.getAbsolutePath() + "\"", null);
newUri =getContentResolver().insert(uri, values);
RingtoneManager.setActualDefaultRingtoneUri(
AudioSetti开发者_JAVA技巧ngs.this,
RingtoneManager.TYPE_RINGTONE,
newUri
);
But now i had a too long list of ring tones. Please help me to delete some items from the same
Thanks Vishnu V
精彩评论