Skip to content

Commit

Permalink
修复歌曲设置铃声后从音乐库消失的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wangchenyan committed Jun 7, 2016
1 parent 8f98669 commit e8d0f79
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ private void setRingtone(Music music) {
if (cursor.moveToFirst() && cursor.getCount() > 0) {
String _id = cursor.getString(0);
ContentValues values = new ContentValues();
values.put(MediaStore.Audio.Media.IS_MUSIC, true);
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);
values.put(MediaStore.Audio.Media.IS_NOTIFICATION, false);
values.put(MediaStore.Audio.Media.IS_PODCAST, false);

getActivity().getContentResolver().update(uri, values, MediaStore.MediaColumns.DATA +
"=?", new String[]{music.getUri()});
Expand Down

0 comments on commit e8d0f79

Please sign in to comment.