diff --git a/app/src/main/java/io/legado/app/service/AudioPlayService.kt b/app/src/main/java/io/legado/app/service/AudioPlayService.kt index 3b1c92eec..fb15d022d 100644 --- a/app/src/main/java/io/legado/app/service/AudioPlayService.kt +++ b/app/src/main/java/io/legado/app/service/AudioPlayService.kt @@ -74,7 +74,7 @@ class AudioPlayService : BaseService(), Action.play -> { title = intent.getStringExtra("title") ?: "" subtitle = intent.getStringExtra("subtitle") ?: "" - position = intent.getIntExtra("pageIndex", 0) + position = intent.getIntExtra("position", 0) play(intent.getStringExtra("url")) } Action.pause -> pause(true) diff --git a/app/src/main/java/io/legado/app/service/help/AudioPlay.kt b/app/src/main/java/io/legado/app/service/help/AudioPlay.kt index 48d3f5b15..10d6d6026 100644 --- a/app/src/main/java/io/legado/app/service/help/AudioPlay.kt +++ b/app/src/main/java/io/legado/app/service/help/AudioPlay.kt @@ -13,7 +13,7 @@ object AudioPlay { intent.putExtra("title", title) intent.putExtra("subtitle", subtitle) intent.putExtra("url", url) - intent.putExtra("dataKey", position) + intent.putExtra("position", position) context.startService(intent) } diff --git a/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt b/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt index 7831eeda2..191c03d1d 100644 --- a/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt @@ -19,7 +19,7 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application) var coverData = MutableLiveData() var book: Book? = null var inBookshelf = false - var chapterSize = 0 + private var chapterSize = 0 var callBack: CallBack? = null var durChapterIndex = 0 var durPageIndex = 0