优化
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user