itkach / aard2-android

Aard2 for Android, a simple dictionary app
GNU General Public License v3.0
425 stars 98 forks source link

Scrolling down the list too quickly will cause a crash #139

Closed sjl872964789 closed 2 years ago

sjl872964789 commented 2 years ago

Describe the bug Scrolling down the list too quickly will cause a crash

To Reproduce

  1. Open the app
  2. Search for any character
  3. Quickly scroll down the search list
  4. Crash

Expected behavior won't crash

Screenshots https://user-images.githubusercontent.com/15941953/161542219-44720ba5-5401-4026-a483-d15bdd109966.mp4

Smartphone (please complete the following information):

Logcat 04-04 20:13:10.278 16236 16236 E AndroidRuntime: FATAL EXCEPTION: main 04-04 20:13:10.278 16236 16236 E AndroidRuntime: Process: itkach.aard2, PID: 16236 04-04 20:13:10.278 16236 16236 E AndroidRuntime: java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. Make sure your adapter calls notifyDataSetChanged() when its content changes. [in ListView(16908298, class android.widget.ListView) with Adapter(class itkach.aard2.BlobListAdapter)] 04-04 20:13:10.278 16236 16236 E AndroidRuntime: at android.widget.ListView.layoutChildren(ListView.java:1717) 04-04 20:13:10.278 16236 16236 E AndroidRuntime: at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:4869) 04-04 20:13:10.278 16236 16236 E AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1352) 04-04 20:13:10.278 16236 16236 E AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:1149) 04-04 20:13:10.278 16236 16236 E AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:1040) 04-04 20:13:10.278 16236 16236 E AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1333) 04-04 20:13:10.278 16236 16236 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:938) 04-04 20:13:10.278 16236 16236 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 04-04 20:13:10.278 16236 16236 E AndroidRuntime: at android.os.Looper.loop(Looper.java:233) 04-04 20:13:10.278 16236 16236 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8030) 04-04 20:13:10.278 16236 16236 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 04-04 20:13:10.278 16236 16236 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631) 04-04 20:13:10.278 16236 16236 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978) 04-04 20:14:02.062 16237 16237 E AndroidRuntime: FATAL EXCEPTION: main 04-04 20:14:02.062 16237 16237 E AndroidRuntime: Process: itkach.aard2, PID: 16237 04-04 20:14:02.062 16237 16237 E AndroidRuntime: java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. Make sure your adapter calls notifyDataSetChanged() when its content changes. [in ListView(16908298, class android.widget.ListView) with Adapter(class itkach.aard2.BlobListAdapter)] 04-04 20:14:02.062 16237 16237 E AndroidRuntime: at android.widget.ListView.layoutChildren(ListView.java:1717) 04-04 20:14:02.062 16237 16237 E AndroidRuntime: at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:4869) 04-04 20:14:02.062 16237 16237 E AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1352) 04-04 20:14:02.062 16237 16237 E AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:1149) 04-04 20:14:02.062 16237 16237 E AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:1040) 04-04 20:14:02.062 16237 16237 E AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1333) 04-04 20:14:02.062 16237 16237 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:938) 04-04 20:14:02.062 16237 16237 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 04-04 20:14:02.062 16237 16237 E AndroidRuntime: at android.os.Looper.loop(Looper.java:233) 04-04 20:14:02.062 16237 16237 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8030) 04-04 20:14:02.062 16237 16237 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 04-04 20:14:02.062 16237 16237 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631) 04-04 20:14:02.062 16237 16237 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)