title: how to resolve lateinit property chargeSessionRepo has not been initialized
body: <p>in a class which extends BroadcasrReceiver, I want to access a repository function.
  I get an error <code>lateinit property chargeSessionRepo has not been initialized</code>.</p>
  <p>I have specified @Inject, what else needs to be done, so I can access the function in <code>ChargeSessionRepository</code></p>
  <pre><code>class CustomNotificationListener : BroadcastReceiver() {
          @Inject
          lateinit var chargeSessionRepo: ChargeSessionRepository
  
          override fun onReceive(context: Context, intent: Intent) {
              Log.d(&quot;fcmService&quot;, &quot;onReceive ${intent.getStringExtra(&quot;onClickListener&quot;)}&quot;)
              when(intent.getStringExtra(&quot;onClickListener&quot;)) {
                  &quot;approve&quot; -&gt; {
                      approvePlugin(true)
                  }
                  &quot;deny&quot; -&gt; {
                      approvePlugin(false)
                  }
              }
          }
  
          private fun approvePlugin(isApproved: Boolean) {
              GlobalScope.launch {
                  try {
                      val chargeStatusUpdate = chargeSessionRepo.getChargeStatusUpdate().data
                      val chargeStatus = chargeStatusUpdate?.firstOrNull()
  
                      chargeStatus?.sessionId?.let {
                          chargeSessionRepo.approvePlugIn(it, isApproved)
                      }
                  } catch (exception: Exception) {
                      Log.d(&quot;fcmService&quot;, &quot;exception: ${exception}&quot;) // lateinit property chargeSessionRepo has not been initialized
                  }
              }
          }
      }
  </code></pre>
  <p>ChargesessionRepository</p>
  <pre><code>@Singleton
  class ChargeSessionRepository @Inject constructor(
      private val chargeSessionService: ChargeSessionService,
      private val chargeSessionDao: ChargeSessionDao
  
  ) : Repository() {
  
      var lastChargeStatus: List&lt;ChargeStatusDTO&gt;? = null
          private set
  
      suspend fun getChargeStatusUpdate(): Resource&lt;List&lt;ChargeStatusDTO&gt;&gt; {
          val resource = getResource { chargeSessionService.getChargeStatus() }
          lastChargeStatus = resource.data
  
          return resource
      }
  }
  </code></pre>
  <p>could you please suggest how to do this</p>
  <p>Thanks
  R</p>