Extracting the view creation from the activity