let uploadWorkRequest: WorkRequest = new OneTimeWorkRequest.Builder(DelayWorker.class)
.setInitialDelay(10, TimeUnit.MINUTES)
.build();
这里面class是一个DelayWorker的父类的对象,不是DelayWorker的对象,而且DelayWorker对象参数太多,根本不可能用DelayWorker().javaClass传,有什么办法传入类的class对象吗?
//这是转换的kt代码
val uploadWorkRequest: WorkRequest = OneTimeWorkRequest.Builder(UploadWorker::class.java)
.setInitialDelay(10, TimeUnit.MINUTES)
.build()
0 个回复