首页 > 解决方案 > myMediaPlayer.getDuration(); 显示错误

问题描述

为什么会myMediaPlayer.getDuration();显示错误?

图片说明在这里

songTextLabel.setText(songName);
songTextLabel.setSelected(true);
        
position= bundle.getInt("pos",0);
Uri u=Uri.parse(mySongs.get(position).toString());
        
myMediaPlayer= MediaPlayer.create(getApplicationContext(),u);
        
myMediaPlayer.start();
songSeekbar.getMax(myMediaPlayer.getDuration());

标签: androidandroid-studio

解决方案


推荐阅读