A user error report has left me scratching my head. The base widget in
my main activity is a ViewGroup descendant that allows the user to
slide between different screens. This is my overridden
onDetachedFromWindow function:
@Override
protected void onDetachedFromWindow() {
// This helps the GC along. Before doing this I experienced
occasional
// out of memory errors when the activity was recreated.
this.removeAllViews();
}
My error reporting mechanism (ACRA) sent me the following error. The
only line in the stacktrace that involves non android code is in the
above function.
Device: Samsung GT-P7510
Android version: 3.1
Stack-trace:
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.AbsListView.onDetachedFromWindow(AbsListView.java:
2488)
at android.view.View.dispatchDetachedFromWindow(View.java:8209)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:
1968)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:
1966)
at android.view.ViewGroup.removeAllViewsInLayout(ViewGroup.java:3401)
at android.view.ViewGroup.removeAllViews(ViewGroup.java:3354)
at com.myapp.app.ViewSlider.onDetachedFromWindow(ViewSlider.java:158)
at android.view.View.dispatchDetachedFromWindow(View.java:8209)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:
1968)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:
1966)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:
1966)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:
1966)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:
1966)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:
1966)
at android.view.ViewRoot.dispatchDetachedFromWindow(ViewRoot.java:
1887)
at android.view.ViewRoot.doDie(ViewRoot.java:3213)
at android.view.ViewRoot.die(ViewRoot.java:3181)
at
android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:
222)
at android.view.Window
$LocalWindowManager.removeViewImmediate(Window.java:538)
at
android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:
2915)
at android.app.ActivityThread.access$2100(ActivityThread.java:122)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
1038)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4028)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:844)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)
I've never run into this problem myself even though that code has been
in the codebase for months. A google search shows someone with a
similar stack-trace:
https://github.com/johannilsson/android-pulltorefresh/issues/19
Any ideas?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en