diff --git a/app/src/main/java/me/kyuubiran/qqcleaner/utils/Utils.kt b/app/src/main/java/me/kyuubiran/qqcleaner/utils/Utils.kt index d6f3b48..d1c3f06 100644 --- a/app/src/main/java/me/kyuubiran/qqcleaner/utils/Utils.kt +++ b/app/src/main/java/me/kyuubiran/qqcleaner/utils/Utils.kt @@ -259,6 +259,7 @@ fun viewCpy(srcView: T): T? { } } +//仅限构造无参的类型 fun objCpy(srcObj: T): T? { return try { var clz: Class<*> = srcObj!!::class.java @@ -292,7 +293,7 @@ fun fieldCpy(srcObj: T, newObj: T): T? { } clz = clz.superclass } - newObj as T + newObj } catch (e: Exception) { loge(e) null