java编写的音乐播放器如何让进度条和音乐关联起来 点击进度条的指定位置 音乐就从指定位置开始播放 20
java编写的音乐播放器如何让进度条和音乐关联起来点击进度条的指定位置音乐就从指定位置开始播放跪求大神...
java编写的音乐播放器如何让进度条和音乐关联起来 点击进度条的指定位置 音乐就从指定位置开始播放跪求大神
展开
1个回答
展开全部
//变量:
private SeekBar seekbar;
private MediaPlayer player = null;
player = new MediaPlayer();//初始化
seekbar.setMax(player.getDuration());//设进度条显示
//音量:
audioManager=(AudioManager)getSystemService(AUDIO_SERVICE);
int MaxSound=audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
maxVolumeTextView.setText(String.valueOf(MaxSound));
SoundseekBar.setMax(MaxSound);
int currentSount=audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
SoundseekBar.setProgress(currentSount);
SoundseekBar.setOnSeekBarChangeListener(new SeekBarListener());
ProceseekBar2.setOnSeekBarChangeListener(new ProcessBarListener());
private SeekBar seekbar;
private MediaPlayer player = null;
player = new MediaPlayer();//初始化
seekbar.setMax(player.getDuration());//设进度条显示
//音量:
audioManager=(AudioManager)getSystemService(AUDIO_SERVICE);
int MaxSound=audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
maxVolumeTextView.setText(String.valueOf(MaxSound));
SoundseekBar.setMax(MaxSound);
int currentSount=audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
SoundseekBar.setProgress(currentSount);
SoundseekBar.setOnSeekBarChangeListener(new SeekBarListener());
ProceseekBar2.setOnSeekBarChangeListener(new ProcessBarListener());
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询