I know how to get the root view with View.getRootView(). I am also able to get the view from a button\'s onClick event where the argument is a View. But how can
onClick
For those of you who are using the Data Binding Library, to get the root of the current activity, simply use:
View rootView = dataBinding.getRoot();
And for Kotlin users, it's even simpler:
val rootView = dataBinding.root