Insert on Room DB does not trigger Observer on Activity

后端 未结 1 879
暖寄归人
暖寄归人 2021-01-28 07:42

In my activity i have an Observer that observes this query

@Query(\"\"\"Select *,
        (Select account_id from accounts where account_id = from_account_id) as         


        
相关标签:
1条回答
  • 2021-01-28 08:30

    Finally my problem was with Dagger injection. In my application class i was setting tw different instances of AppDaggerComponent and inject those to the application and the WorkManager.

    // Before
            DaggerAppComponent.factory().withContext(this).inject(this)
    
            val factory: AppWorkerFactory = DaggerAppComponent.factory().withContext(this).workerFactory()
            WorkManager.initialize(this, Configuration.Builder().setWorkerFactory(factory).build())
    
    // After
            val daggerAppComponent = DaggerAppComponent.factory().withContext(this)
            daggerAppComponent.inject(this)
    
            val factory: AppWorkerFactory = daggerAppComponent.workerFactory()
            WorkManager.initialize(this, Configuration.Builder().setWorkerFactory(factory).build())
    

    PROBLEM SOLVED...!!

    0 讨论(0)
提交回复
热议问题