Skip to content Skip to sidebar Skip to footer

Insert On Room Db Does Not Trigger Observer On Activity

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 contact_account_id,

Solution 1:

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())

// Afterval daggerAppComponent = DaggerAppComponent.factory().withContext(this)
        daggerAppComponent.inject(this)

        val factory: AppWorkerFactory = daggerAppComponent.workerFactory()
        WorkManager.initialize(this, Configuration.Builder().setWorkerFactory(factory).build())

PROBLEM SOLVED...!!

Post a Comment for "Insert On Room Db Does Not Trigger Observer On Activity"