scwang90 / SmartRefreshLayout

🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了几十种炫酷的Header和 Footer。
https://segmentfault.com/a/1190000010066071
Apache License 2.0
24.95k stars 4.95k forks source link

连续使用 autoRefresh() 方法刷新列表,会闪退 #1563

Open tiansuo opened 7 months ago

tiansuo commented 7 months ago

错误代码:

java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@2a50f92 at android.graphics.BaseCanvas.throwIfCannotDraw(BaseCanvas.java:74) at android.graphics.MiuiCanvas.throwIfCannotDraw(MiuiCanvas.java:358) at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:263) at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:94) at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:549) at android.widget.ImageView.onDraw(ImageView.java:1462) at android.view.View.draw(View.java:23019) at android.view.View.updateDisplayListIfDirty(View.java:21887) at android.view.View.draw(View.java:22745) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4300) at android.view.View.updateDisplayListIfDirty(View.java:21878) at android.view.View.draw(View.java:22745) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4300) at android.view.View.updateDisplayListIfDirty(View.java:21878) at android.view.View.draw(View.java:22745) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4300) at android.view.View.draw(View.java:23023) at android.view.View.updateDisplayListIfDirty(View.java:21887) at android.view.View.draw(View.java:22745) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4300) at android.view.View.updateDisplayListIfDirty(View.java:21878) at android.view.View.draw(View.java:22745) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at androidx.recyclerview.widget.RecyclerView.drawChild(RecyclerView.java:5204) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4300) at android.view.View.draw(View.java:23023) at androidx.recyclerview.widget.RecyclerView.draw(RecyclerView.java:4603) at android.view.View.updateDisplayListIfDirty(View.java:21887) at android.view.View.draw(View.java:22745) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4300) at android.view.View.updateDisplayListIfDirty(View.java:21878) at android.view.View.draw(View.java:22745) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4300) at android.view.View.updateDisplayListIfDirty(View.java:21878) at android.view.View.draw(View.java:22745) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4300) at android.view.View.updateDisplayListIfDirty(View.java:21878) at android.view.View.draw(View.java:22745) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4300) at android.view.View.updateDisplayListIfDirty(View.java:21878) at android.view.View.draw(View.java:22745) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4300) at android.view.View.updateDisplayListIfDirty(View.java:21878) at android.view.View.draw(View.java:22745) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4300) at android.view.View.updateDisplayListIfDirty(View.java:21878) at android.view.View.draw(View.java:22745) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4300) at android.view.View.draw(View.java:23023) at com.android.internal.policy.DecorView.draw(DecorView.java:888) at android.view.View.updateDisplayListIfDirty(View.java:21887) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:534) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:542) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:625) at android.view.ViewRootImpl.draw(ViewRootImpl.java:4660) 2024-04-18 17:40:48.516 29304-29304 CrashReport com.virtual.ailover E at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4378) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3489) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2280) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9026) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1144) at android.view.Choreographer.doCallbacks(Choreographer.java:948) at android.view.Choreographer.doFrame(Choreographer.java:877) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1129) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:210) at android.os.Looper.loop(Looper.java:299) at android.app.ActivityThread.main(ActivityThread.java:8337) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1037)

tiansuo commented 7 months ago

加了延迟就好了,不会闪退了,autoRefresh(100)