Android 9 Development Cookbook(Third Edition)
上QQ阅读APP看书,第一时间看更新

There's more...

As well as identifying a layout using a resource ID, as we did here, setContentView() can also take a View as an argument, for example:

findViewById(R.id.myView) 
setContentView(myView);