Saran Sankaran
05/15/2020, 5:51 AMcheckOrginization()
method after completing the loop in success listener. Am’I getting it right?Remon Shehata
05/15/2020, 7:48 AMSaran Sankaran
05/15/2020, 7:52 AMcheckOrganization()
that function is called immediately. In that function you are creating listener addOnSuccessListener{}
, that will be called whenever there is a success. Or might never be called in the case of failure, you cannot keep checkOrganization()
blocked until then.Remon Shehata
05/15/2020, 7:53 AMSaran Sankaran
05/15/2020, 7:56 AMaddOnSuccessListener{}
Remon Shehata
05/15/2020, 8:01 AMSaurabh
05/15/2020, 11:35 AMsuspendCancellableCoroutine
and resume the coroutine with success, whenever you want.Remon Shehata
05/15/2020, 11:36 AMSaurabh
05/15/2020, 11:38 AMRemon Shehata
05/15/2020, 11:41 AM