Skip to content

Commit

Permalink
Update Utils
Browse files Browse the repository at this point in the history
  • Loading branch information
KyuubiRan committed Mar 10, 2021
1 parent 112a5e1 commit f9b7d04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/main/java/me/kyuubiran/qqcleaner/utils/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ fun <T : View> viewCpy(srcView: T): T? {
}
}

//仅限构造无参的类型
fun <T> objCpy(srcObj: T): T? {
return try {
var clz: Class<*> = srcObj!!::class.java
Expand Down Expand Up @@ -292,7 +293,7 @@ fun <T> fieldCpy(srcObj: T, newObj: T): T? {
}
clz = clz.superclass
}
newObj as T
newObj
} catch (e: Exception) {
loge(e)
null
Expand Down

0 comments on commit f9b7d04

Please sign in to comment.