AriaLyy 7 years ago
parent 89289204a0
commit 8e541a8b2a
  1. 17
      Aria/src/main/java/com/arialyy/aria/orm/SqlUtil.java
  2. 1
      app/src/main/java/com/arialyy/simple/download/group/DownloadGroupActivity.java

@ -17,6 +17,7 @@ package com.arialyy.aria.orm;
import android.database.sqlite.SQLiteDatabase;
import android.text.TextUtils;
import android.util.Log;
import com.arialyy.aria.util.CommonUtil;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
@ -91,11 +92,11 @@ final class SqlUtil {
throw new IllegalArgumentException("List中元素必须被@NormalList注解");
}
if (TextUtils.isEmpty(str)) return null;
String[] datas = str.split("$$");
String[] datas = str.split("\\$\\$");
List list = new ArrayList();
String type = normalList.clazz().getName();
for (String data : datas) {
list.add(checkData(data, type));
list.add(checkData(type, data));
}
return list;
}
@ -176,17 +177,13 @@ final class SqlUtil {
}
private static Object checkData(String type, String data) {
switch (type) {
case "String":
if (type.equalsIgnoreCase("java.lang.String")){
return data;
case "int":
case "Integer":
}else if (type.equalsIgnoreCase("int") || type.equals("java.lang.Integer")){
return Integer.parseInt(data);
case "double":
case "Double":
}else if (type.equalsIgnoreCase("double") || type.equals("java.lang.Double")){
return Double.parseDouble(data);
case "float":
case "Float":
}else if (type.equalsIgnoreCase("float") || type.equals("java.lang.Float")){
return Float.parseFloat(data);
}
return null;

@ -49,6 +49,7 @@ public class DownloadGroupActivity extends BaseActivity<ActivityDownloadGroupBin
Aria.download(this).register();
setTitle("任务组");
mUrls = getModule(GroupModule.class).getUrls();
DownloadGroupEntity e = Aria.download(this).getGroupTaskList().get(0);
DownloadGroupTaskEntity entity = Aria.download(this).getDownloadGroupTask(mUrls);
if (entity != null && entity.getEntity() != null) {
DownloadGroupEntity groupEntity = entity.getEntity();

Loading…
Cancel
Save