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
Inside our activity we can get the root view with:
root
ViewGroup rootView = (ViewGroup) ((ViewGroup) this .findViewById(android.R.id.content)).getChildAt(0);
or
View rootView = getWindow().getDecorView().getRootView();