79530641

Date: 2025-03-24 09:17:36
Score: 0.5
Natty:
Report link

Use can also use Coroutines with lifecycleScope to lunch network call in background thread

In Activity the best way to call retrieveInfo() inside onCreate or OnResume method

// Call suspend function safely  here inside coroutine scope
lifecycleScope.launch{
  val info = retriveInfo()
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Jaspalsinh Gohil