This commit is contained in:
Xwite
2023-03-23 20:11:59 +08:00
parent e5da28d92b
commit 0e65493dbe
2 changed files with 3 additions and 4 deletions
@@ -23,9 +23,8 @@ object CheckSource {
val summary get() = upSummary() val summary get() = upSummary()
fun start(context: Context, sources: List<BookSource>) { fun start(context: Context, sources: List<BookSource>) {
val selectedIds: ArrayList<String> = arrayListOf() val selectedIds = sources.map {
sources.map { it.bookSourceUrl
selectedIds.add(it.bookSourceUrl)
} }
IntentData.put("checkSourceSelectedIds", selectedIds) IntentData.put("checkSourceSelectedIds", selectedIds)
context.startService<CheckSourceService> { context.startService<CheckSourceService> {
@@ -66,7 +66,7 @@ class CheckSourceService : BaseService() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
when (intent?.action) { when (intent?.action) {
IntentAction.start -> IntentData.get<ArrayList<String>>("checkSourceSelectedIds")?.let { IntentAction.start -> IntentData.get<List<String>>("checkSourceSelectedIds")?.let {
check(it) check(it)
} }