When a view is shown, call buildUi.