Created
October 25, 2020 09:33
-
-
Save seanghay/c3927e1e0c2fb1b56894a0dac3501b04 to your computer and use it in GitHub Desktop.
Inflate ViewBinding inside Activity
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
class MainActivity : AppCompatActivity() { | |
private lateinit var binding: ActivityMainBinding | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
// inflate view binding | |
binding = ActivityMainBinding.inflate(layoutInflater) | |
setContentView(binding.root) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment