Open zhucidong opened 7 years ago
反馈问题时请提供当前使用开源库具体版本号、报错手机型号、报错手机系统版本以及错误日志
用的是 compile 'cn.bingoogolapple:bga-swipebacklayout:1.1.5' 任何机型都是一样的报错 报错重现的方式如下: 将代码中recyclerview替换成compile 'com.yanzhenjie:recyclerview-swipe:1.1.3' 包下面的SwipeMenuRecyclerView 此SwipeMenuRecyclerView是继承自recyclerview的 点击SwipeMenuRecyclerView(列表)中的一个item 跳转到B(详情)页面 然后左滑详情页面,返回到列表页,就会报错,如果是点击手机返回键则不会报错。 报错信息如下:
Process: com.tgram.base.czf, PID: 22501 java.lang.IllegalStateException: Observer com.yanzhenjie.recyclerview.swipe.SwipeMenuRecyclerView$2@c582719 was not registered. at android.database.Observable.unregisterObserver(Observable.java:69) at android.support.v7.widget.RecyclerView$Adapter.unregisterAdapterDataObserver(RecyclerView.java:6583) at com.yanzhenjie.recyclerview.swipe.SwipeMenuRecyclerView.onDetachedFromWindow(SwipeMenuRecyclerView.java:331) at android.view.View.dispatchDetachedFromWindow(View.java:16864) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3406) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3398) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3398) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3398) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3398) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3398) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3398) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3398) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3398) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4936) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4910) at android.view.ViewGroup.removeView(ViewGroup.java:4841) at cn.bingoogolapple.swipebacklayout.BGASwipeBackShadowView.unBindPreActivity(BGASwipeBackShadowView.java:157) at cn.bingoogolapple.swipebacklayout.BGASwipeBackLayout.dispatchOnPanelOpened(BGASwipeBackLayout.java:483) at cn.bingoogolapple.swipebacklayout.BGASwipeBackLayout$DragHelperCallback.onViewDragStateChanged(BGASwipeBackLayout.java:1512) at android.support.v4.widget.ViewDragHelper.setDragState(ViewDragHelper.java:881) at android.support.v4.widget.ViewDragHelper$2.run(ViewDragHelper.java:338) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6832) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1543) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1431)
这个问题根源可能是对前面一个Activity的rootView做了remove、add操作引起的
没有remove、add等操作 就是个很普通的详情页面,只要侧滑,露出之前的列表页面就会报错。 如果之前的不是列表页面,则一切正常 根源问题:只要是从带有SwipeMenuRecyclerView的页面跳转到其他页面,然后通过侧滑返回就会报错 报错内容上面已经发过了
不是你业务层做的remove、add操作;是咱底层的侧滑事件里面,会把前一个Activity的rootView加到当前的Activity
SwipeMenuRecyclerView是在 compile 'com.yanzhenjie:recyclerview-swipe:1.1.3' 包下面的
/**
添加之后还是崩溃