我有这段代码:
File mp3 = new File(song.getPath());
AudioFile f = AudioFileIO.read(mp3);
Tag tag = f.getTag();
tag.setField(FieldKey.TITLE,songTitle.getText().toString());
tag.setField(FieldKey.ALBUM,albumTitle.getText().toString());
tag.setField(FieldKey.ARTIST,artistTitle.getText().toString());
AudioFileIO.write(f);
更改仅在重启设备后生效。你知道怎么解决它吗?
答案 0 :(得分:0)
向媒体扫描器发送广播,然后刷新内容解析器以查看mp3文件的更改。
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(mp3)));