我在我的项目中使用了 pagerTabStrip
<com.astuetz.PagerSlidingTabStrip
其中有一些固定的选项卡是动态添加的。此操作包括根据数据多次使用 notifydatasetchanged()。
StackTrace 是
java.lang.IllegalStateException: Observer com.astuetz.f@4190d0f8 was not registered.
at android.database.Observable.unregisterObserver(Observable.java:69)
at android.support.v4.view.be.unregisterDataSetObserver(PagerAdapter.java:294)
at com.astuetz.PagerSlidingTabStrip.onDetachedFromWindow(PagerSlidingTabStrip.java:548)
at android.view.View.dispatchDetachedFromWindow(View.java:12620)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2591)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2589)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2589)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2589)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2589)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2589)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2589)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2589)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2589)
at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:2834)
at android.view.ViewRootImpl.doDie(ViewRootImpl.java:5271)
at android.view.ViewRootImpl.die(ViewRootImpl.java:5248)
at android.view.WindowManagerGlobal.removeViewLocked(WindowManagerGlobal.java:346)
at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:301)
at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:84)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3522)
at android.app.ActivityThread.access$1400(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1252)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5095)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(NativeStart.java)
请让我知道我做错了什么。任何帮助将不胜感激。