Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在屏幕上有媒体播放器和一个显示 .mp3 文件(位置)进度的 seekBar。当 seekBar 到达末尾(最大值)而不使用 mediaPlayer 时如何捕获事件?有没有其他方法或者我需要检查每次进度更改并手动触发事件?
为什么不想使用与 SeekBar 关联的 MediaPlayer?MediaPlayer 公开了一个 onCompletion 回调:
OnCompletionListener cListener = new OnCompletionListener(){ public void onCompletion(MediaPlayer mp){ //do something } }; mediaPlayer.setOnCompletionListener(cListener);