实现效果比较不错,接下来粘一下代码
<SeekBar
android:id="@+id/detail_seekbar"
android:layout_width="match_parent"
android:layout_height="20dp"
android:thumbTint="#111"
android:layout_gravity="center"
/>
Service代码:(主要是使用Binder提供对外方法)
public class testDetailService extends Service {
private static final String TAG = "PlayerService";
private String url;
private MediaPlayer mediaPlayer;
public testDetailService() {
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
///storage/emulated/0/netease/cloudmusic/Music/孟大宝 房东的猫 - 秋又来了.mp3
mediaPlayer = MediaPlayer.create(testDetailService.this, Uri.parse("file://" + "/storage/emulated/0/netease/cloudm