Android Studio Clear Views of Layout

//either this
layout.removeAllViews();

//or this
((LinearLayout) findViewById(R.id.layout)).removeAllViews();
Rapha149