Skip to content

Instantly share code, notes, and snippets.

@Audhil Audhil/somefile.kt
Created Jul 27, 2019

Embed
What would you like to do?
class MainActivity : AppCompatActivity() {
@Inject lateinit var info: Info
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
DaggerMagicBox.create().poke(this)
text_view.text = info.text
}
}
class Info @Inject constructor() {
val text = "Hello Dagger 2"
}
@Component
interface MagicBox {
fun poke(app: MainActivity)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.