fun saveFileInLC(filename: String, path: String, attachmentClass: LCObject?, msg: String?, onSuccess: (LCFile) -> Unit = {}) {
val file = LCFile.withAbsoluteLocalPath(filename, path)
file.saveInBackground().subscribe(ObserverImpl<LCFile>(msg) {
// 成功回调
attachmentClass?.add("attachments", it)
attachmentClass?.save()
})
}
不知道这里是不是有点bug,在android中只要我上传文件成功后,在回调中关联某个LCObject,主线程就会被卡死。