Android 在Adroid中是否可以等待处理完成,然后继续处理?

Android 在Adroid中是否可以等待处理完成,然后继续处理?,android,kotlin,Android,Kotlin,我正在创建获取请求并将该请求发送到另一个应用程序的服务。我尝试使用a进行编码,问题是当我将请求发送到其他应用程序时,进程正在继续,但没有得到答复。。。我怎样才能控制这一切 我的示例代码 val Req = Process1(processType = Request()) Req.request("process1") if (CheckLogin()) {//this process continues itself... and not waiting sent r

我正在创建获取请求并将该请求发送到另一个应用程序的服务。我尝试使用a进行编码,问题是当我将请求发送到其他应用程序时,进程正在继续,但没有得到答复。。。我怎样才能控制这一切

我的示例代码

val Req = Process1(processType = Request())
Req.request("process1")


 if (CheckLogin()) {//this process continues itself... and not waiting sent request response
     val spReq = Process2(processType = Request())
     spReq.request("process2")
 } else {
      return "error-error"
 }
 
 private fun CheckLogin(): Boolean {
    var chk = false
    if (response == "Success")
        chk = true
    return chk
}
这是process1类

class SimplePayment(override val processType: Processes) : Types {
override fun request(type:String,messageValue: String) {
     processType.processRequest(type,message)
}
}
这是我的要求

class Request : Processes {
override fun processRequest(type:String) {
    //send request and  get response
    val Res = Process1(processType = Response())
    Res.response(message)
}
}
这是我的反应课

class PaymentResponseProcess: PaymentProcesses {


override fun processRequest(type: String, message: String) {
    //send response to main task
}
}
这里是我的界面

interface Types {
val processType: Processes
   fun request(message:String)
   fun response( message:String)
}
interface Processes {
   fun Request(message: String)
   fun Response(message:String)
}