Remove all items inside linearlayout February 13, 2023 by Tarik Why you wrote linearLayout.getParent()? You should call this directly on LinearLayout: linearLayout.removeAllViews();