What is trigger this Exception instance: “java.lang.IllegalArgumentException: The observer is null.” and how could it be avoid?

I made the silly mistake of thinking that none of my classes were mentioned in the trace, but LoadingDataView is one of them. It doesn't show in the original trace but another that was related.

I made the silly mistake of thinking that none of my classes were mentioned in the trace, but LoadingDataView is one of them. It doesn't show in the original trace but another that was related. Inside that class there is an anonymous ArrayAdapter that was where the incident is happening so I added this as a work around: @Override public void unregisterDataSetObserver(DataSetObserver observer) { if (observer!

= null) { super. UnregisterDataSetObserver(observer); } } And it seems to work now although I'm still not sure why this method was called twice. Although, for now on I'm going to use Fragments as much as I can ;).

I have just seen similar on ICS when I got my Galaxy Nexus... - it worked fine before! I use a 3 page ViewPager that have PullToRefreshListView (https://github.com/johannilsson/android-pulltore...) in it and it works fine again when replacing these with standard ListViews. I slide to right, back and right again and it crashes with: java.lang.

IllegalArgumentException: The observer is null. At android.database.Observable. UnregisterObserver(Observable.

Java:59) at android.widget.BaseAdapter. UnregisterDataSetObserver(BaseAdapter. Java:42) at android.widget.

HeaderViewListAdapter. UnregisterDataSetObserver(HeaderViewListAdapter. Java:256) at android.widget.AbsListView.

OnDetachedFromWindow(AbsListView. Java:2373) at android.view.View. DispatchDetachedFromWindow(View.

Java:9756) at android.view.ViewGroup. DispatchDetachedFromWindow(ViewGroup. Java:2274) at android.view.ViewGroup.

DispatchDetachedFromWindow(ViewGroup. Java:2272) at android.view.ViewGroup. RemoveViewInternal(ViewGroup.

Java:3588) at android.view.ViewGroup. RemoveViewInternal(ViewGroup. Java:3568) at android.view.ViewGroup.

RemoveView(ViewGroup. Java:3516) at com.xxxx.android.common. NewsFeedDetailsActivity$LocalAdapter.

DestroyItem(NewsFeedDetailsActivity. Java:150) at android.support. V4.view.ViewPager.

Populate(ViewPager. Java:415) at android.support. V4.view.ViewPager.

CompleteScroll(ViewPager. Java:696) at android.support. V4.view.ViewPager.

ComputeScroll(ViewPager. Java:668) at android.view.ViewGroup. DrawChild(ViewGroup.

Java:2742) at android.view.ViewGroup. DispatchDraw(ViewGroup. Java:2495) at android.view.ViewGroup.

DrawChild(ViewGroup. Java:2897) at android.view.ViewGroup. DispatchDraw(ViewGroup.

Java:2495) at android.view.ViewGroup. DrawChild(ViewGroup. Java:2897) at android.view.ViewGroup.

DispatchDraw(ViewGroup. Java:2495) at android.view.ViewGroup. DrawChild(ViewGroup.

Java:2897) at android.view.ViewGroup. DispatchDraw(ViewGroup. Java:2495) at android.view.ViewGroup.

DrawChild(ViewGroup. Java:2897) at android.view.ViewGroup. DispatchDraw(ViewGroup.

Java:2495) at android.view.ViewGroup. DrawChild(ViewGroup. Java:2897) at android.view.ViewGroup.

DispatchDraw(ViewGroup. Java:2495) at android.view.View. Draw(View.

Java:10883) at android.widget.FrameLayout. Draw(FrameLayout. Java:450) at com.android.internal.policy.impl.

PhoneWindow$DecorView. Draw(PhoneWindow. Java:2106) at android.view.ViewRootImpl.

Draw(ViewRootImpl. Java:2005) at android.view.ViewRootImpl. PerformTraversals(ViewRootImpl.

Java:1613) at android.view.ViewRootImpl. HandleMessage(ViewRootImpl. Java:2418) at android.os.Handler.

DispatchMessage(Handler. Java:99) at android.os.Looper. Loop(Looper.

Java:137) at android.app.ActivityThread. Main(ActivityThread. Java:4340) at java.lang.reflect.Method.

InvokeNative(Native Method) at java.lang.reflect.Method. Invoke(Method. Java:511) at com.android.internal.os.

ZygoteInit$MethodAndArgsCaller. Run(ZygoteInit. Java:784) at com.android.internal.os.ZygoteInit.

Main(ZygoteInit. Java:551) at dalvik.system.NativeStart. Main(Native Method).

I would recommend you open a new Question since it may be a similar source of the problem but the solution is likely to be different. If you want you can link it with this one by adding a comment here, I'll be interested in seeing what could happen on your case. PS: add some code if you can ;) – pablisco Dec 15 '11 at 11:00 Actually, the solution for this Question would apply to your internal LocalAdapter inside NewsFeedDetailsActivity ;) – pablisco Dec 15 '11 at 11:16.

It is Thrown to indicate that a method has been passed an illegal or inappropriate argument. The seeral cases that I could list down are : argument is null No. Of arguments are not matching the actual method arguments The type of the arguments might be mismatching.

I know what an IllegalArgumentException is. I'm guessing that you haven't even read the question since I am asking the actual events that cause the Exception. I'll change the title accordingly.

– pablisco Dec 15 '11 at 10:39.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions