且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

安卓:无法破坏活动

更新时间:2022-12-19 15:28:40

那么,错误日志pretty的太多解释的那样:不要叫 removeAllViews()适配器视图。而你的code在某一点达到的ViewGroup 也就是适配器视图

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.

只需使用排除这种情况下出的instanceof 检查或处理异常尝试 / 包装。

Just rule this case out using instanceof check or handle exception with try/catch wrapper.