Xwite il y a 3 ans
Parent
commit
6df363b87b

+ 2 - 3
app/src/main/java/io/legado/app/model/CheckSource.kt

@@ -23,9 +23,8 @@ object CheckSource {
     val summary get() = upSummary()
 
     fun start(context: Context, sources: List<BookSource>) {
-        val selectedIds: ArrayList<String> = arrayListOf()
-        sources.map {
-            selectedIds.add(it.bookSourceUrl)
+        val selectedIds = sources.map {
+            it.bookSourceUrl
         }
         IntentData.put("checkSourceSelectedIds", selectedIds)
         context.startService<CheckSourceService> {

+ 1 - 1
app/src/main/java/io/legado/app/service/CheckSourceService.kt

@@ -66,7 +66,7 @@ class CheckSourceService : BaseService() {
 
     override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
         when (intent?.action) {
-            IntentAction.start -> IntentData.get<ArrayList<String>>("checkSourceSelectedIds")?.let {
+            IntentAction.start -> IntentData.get<List<String>>("checkSourceSelectedIds")?.let {
                 check(it)
             }