Created
October 25, 2020 09:36
-
-
Save seanghay/14bac3a7c82f137f097b70e495a2348e to your computer and use it in GitHub Desktop.
Bind ViewBinding to existing view
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) | |
setContentView(R.layout.activity_main) | |
val root: CoordinatorLayout = findViewById(R.id.coordinator_layout) | |
binding = ActivityMainBinding.bind(root) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment