Android: Unable to destroy activity

后端 未结 4 1910
野的像风
野的像风 2021-01-04 13:31

I am using the following code to removes childs on every viewgroup:

protected void onDestroy() {
    super.onDestroy();
    this.liberarMemoria();
}

public          


        
4条回答
  •  醉酒成梦
    2021-01-04 13:45

    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.

提交回复
热议问题