android - 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());
解决方案
推荐阅读
- r - 如何将带有空格的路径字符串变量传递给R中的系统命令
- android - Android MediaPlayer 准备
- android - 如何在回收站视图中检测项目计数
- android - 单元测试时来自 Toast 的 NullPointerException
- javascript - 角高图表颜色。除了 Highcharts.getOptions().colors[index] 还有什么方法可以获取颜色?
- mysql - Mysql触发器,将来自不同表的两个值相乘,按组汇总并将值添加到另一列
- ruby-on-rails - Rails.root - 未初始化的常量
- python - 在某些条件下从数据框中删除重复项
- c++ - 从标准输入将双打存储在向量中
- c++ - C++ 字符数组不接受超过 4 个字符的输入