johannilsson/android-pulltorefresh

IllegalArgumentException: The observer is null

Closed this issue · 2 comments

Hi im facing with this issue, when i try to clear/remove all elements from a layout by programmatically. Mean i have a "container layout" and im inflating different layouts into that container. First i tried with regular list, all working good, but when i try with the pulltorefresh listview, when i try ot remove the elements from the container i`ve got this exception at removeAllViews() command.

Maybe i`m doing something wrong, or it can be an issue.

Note: I`m using Honeycomb 3.0, and the pulltorefresh list is in a fragment.
Note 2: Meantime i noticed while the data is loading i can navigate without any issue, but after the list is loaded i got this exception when i try to change the content of the "container layout" (mean remove the fragment, and replace with an other layout)

Thanks
Alex

06-14 11:21:39.890: ERROR/AndroidRuntime(27387): FATAL EXCEPTION: main
06-14 11:21:39.890: ERROR/AndroidRuntime(27387): java.lang.IllegalArgumentException: The observer is null.
06-14 11:21:39.890: ERROR/AndroidRuntime(27387): at android.database.Observable.unregisterObserver(Observable.java:59)
06-14 11:21:39.890: ERROR/AndroidRuntime(27387): at android.widget.BaseAdapter.unregisterDataSetObserver(BaseAdapter.java:42)
06-14 11:21:39.890: ERROR/AndroidRuntime(27387): at android.widget.HeaderViewListAdapter.unregisterDataSetObserver(HeaderViewListAdapter.java:256)
06-14 11:21:39.890: ERROR/AndroidRuntime(27387): at android.widget.AbsListView.onDetachedFromWindow(AbsListView.java:2307)
06-14 11:21:39.890: ERROR/AndroidRuntime(27387): at android.view.View.dispatchDetachedFromWindow(View.java:7994)
06-14 11:21:39.890: ERROR/AndroidRuntime(27387): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1902)
06-14 11:21:39.890: ERROR/AndroidRuntime(27387): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1900)
06-14 11:21:39.890: ERROR/AndroidRuntime(27387): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1900)
06-14 11:21:39.890: ERROR/AndroidRuntime(27387): at android.view.ViewGroup.removeAllViewsInLayout(ViewGroup.java:3319)
06-14 11:21:39.890: ERROR/AndroidRuntime(27387): at android.view.ViewGroup.removeAllViews(ViewGroup.java:3272)

Hi, thank you for the report.

From the exception it looks like it origins from Androids internal and is not related to the pull to refresh view. I've seen some strange behavior with the list view on honeycomb before, but I'm not sure if they have change something or if we're doing it wrong. I don't have any Honeycomb device so please tell if you find out what is causing it.

Please re-open if this is still an issue.