Skip to content

Instantly share code, notes, and snippets.

@Nyame123
Created June 10, 2021 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nyame123/b4fd102ca88591768a495446f86ef752 to your computer and use it in GitHub Desktop.
Save Nyame123/b4fd102ca88591768a495446f86ef752 to your computer and use it in GitHub Desktop.
class ExampleContentProvider: ContentProvider() {
...
override fun query(...): Cursor {
val appContext = context?.applicationContext ?: throw IllegalStateException()
val hiltEntryPoint =
EntryPointAccessors.fromApplication(appContext, ExampleContentProviderEntryPoint::class.java)
val analyticsService = hiltEntryPoint.analyticsService()
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment