引用网上代码后显示的歌词会重叠,即前一首歌的歌词会叠加上来
查看许久发现是歌词都是保存在同一个LyricList中
解决方案:在每次读取前先new即可
public void lrcView(){
LyricList = new ArrayList<LyricContent>();
mLrcRead = new LrcRead();
Log.i("test",lrcUrl);
try {
mLrcRead.Read(lrcUrl);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
LyricList = mLrcRead.GetLyricContent();
// 设置歌词资源
mLyricView.setSentenceEntities(LyricList);
mHandler.post(mRunnable);
}
目测歌词已经能正常显示
还要完善菜单功能以及播放列表功能
以及遥远的左右滑动切换功能