Last active
October 5, 2020 14:35
-
-
Save droid-lover/166499256ddc20b0562f4647fa0fddb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//add this annotation to make it accessible all dependencies from DI Graph created using HILT | |
@AndroidEntryPoint | |
class MainActivity : AppCompatActivity() { | |
//access viewmodel like this | |
private val sampleViewModel: SampleViewModel by viewModels() | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
//code | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment