android退出一個含有listview的activity時報java.lang.IllegalA

@Override public void unregisterDataSetObserver(DataSetObserver observer) {    if (observer != null) {        super.unregisterDataSetObserver(observer);    } }ide

緣由是:spa

I too was having the same problem and it seems that unregisterDataSetObserver on your DealPageAdapter is being called twice. To fix the problem I overwrote the unregisterDataSetObserver in my Adapter as such
server

看不懂不要緊,總之是adapter的錯。查看代碼發現當請求到的listview的數據list爲空時,依然設置了adapter,並且代碼又被try catch包裹,因此沒有報錯。解決方法就是在設置adapter以前,判斷提供數據的list是否爲null,且其元素是否爲0.it

相關文章
相關標籤/搜索