java.lang.IllegalArgumentException: The observer is null

后端 未结 3 1170
慢半拍i
慢半拍i 2021-02-06 00:48

A user of one of my apps reported this error. I\'m confused as to what it means an how to fix it. After a bit of googling...still no luck. Anyone seen this before or know how

3条回答
  •  被撕碎了的回忆
    2021-02-06 01:24

    An alternative solution is to wrap the ListView and catch the exception. This solution worked for me, and I have yet not found any side effects.

        public class CustumListView extends ListView {

      public CustumListView(Context context, AttributeSet attrs) {
        super(context, attrs);
      }
    
      @Override
      protected void onDetachedFromWindow() {
        try {
          super.onDetachedFromWindow();
        } catch(IllegalArgumentException iae) {
    
        }
      }
    }
    

提交回复
热议问题