Well, the error log pretty much explains it: do not call removeAllViews() on AdapterView. And your code at some point meets ViewGroup that also is AdapterView.
Just rule this case out using instanceof check or handle exception with try/catch wrapper.