关于歌词显示重叠

来源:互联网 发布:java protected关键字 编辑:程序博客网 时间:2024/06/10 01:32

引用网上代码后显示的歌词会重叠,即前一首歌的歌词会叠加上来
查看许久发现是歌词都是保存在同一个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);    }目测歌词已经能正常显示还要完善菜单功能以及播放列表功能以及遥远的左右滑动切换功能
0 0