zhihu / Matisse

:fireworks: A well-designed local image and video selector for Android
Apache License 2.0
12.52k stars 2.06k forks source link

Images dont load when select folder #814

Open lucazin opened 4 years ago

lucazin commented 4 years ago

Describe the bug

I dont know why... when i change the folder in actionbar, the images dont load. Just the initial images load in start. What can i do?

help me please..its working before, i dont know why happen this.

To Reproduce

  1. Open
  2. change folder in select list
  3. done..nothing show
  4. error album not showing

Expected behavior A clear and concise description of what you expected to happen.

Screenshots xx

Smartphone (please complete the following information):

lawonga commented 4 years ago

Just got a bug report where someone killed the app and restated it and went straight into the Matisse image loader and scrolled down a lot and the app crashed from OOM. There is definitively a memory leak in this library.

lawonga commented 4 years ago

Also in this case the loaderManger has a unique id when it should be tied to what you're trying to load. This library is buggy. I'll do a pr when I have time...

mathislaurentpiquoti commented 4 years ago

Same issue for me, when I changed folder, no more items are loaded

arasu33 commented 4 years ago

Same issue for me too

mathislaurentpiquoti commented 4 years ago

I fixed the problem, I replaced in gradle implementation 'androidx.fragment:fragment:1.3.0-alpha08' to implementation 'androidx.fragment:fragment:1.1.0' and it worked fine !! Hope it works for you too

arasu33 commented 4 years ago

Thanks for me also after replacing implementation 'androidx.fragment:fragment:1.3.0-alpha08' with implementation 'androidx.fragment:fragment:1..3.0-alpha06' and it worked fine !!

lucazin commented 4 years ago

Its because fragment version lib?

STPLMAYUR commented 3 years ago

Not able to switch folder. It showing me white screen. I have use this line in build.gradle(app) implementation 'com.zhihu.android:matisse:0.5.3-beta3' After reading above suggestions, I have implemented following libraries and check result, but it also not working:

  1. implementation 'androidx.fragment:fragment:1.1.0'
  2. implementation 'androidx.fragment:fragment:1.3.0-alpha08'
aZyreTech commented 3 years ago

also having same problem even after adding implementation 'androidx.fragment:fragment:1.1.0'

sadeghbarout commented 2 years ago

Same problem! No solution?

chalermpong commented 2 years ago

Here is what I found:

When changing the folder, a new MediaSelectionFragment is created and replaces the old Fragment. Each MediaSelectionFragment has its own loading process (AlbumMediaCollection) which will be started in Fragment.onActivityCreated and will be stopped in Fragment.onDestroyView. This AlbumMediaCollection uses hard-coded LOADER_ID = 2. As a result, stoping one AlbumMediaCollection, will also stop all other running AlbumMediaCollection.

I tested with 2 different versions of androidx.fragment:fragment. For androidx.fragment:fragment 1.4.1, the problem occurs because the second Fragment.onActivityCreated is called before the first Fragment.onDestroyView. Thus, the first fragment will also stop the 2nd Fragment’s AlbumMediaCollection.

For androidx.fragment:fragment 1.1.0, there is no problem because the second Fragment.onActivityCreated is called after the first Fragment.onDestroyView.

Fix: Assign a unique LOADER_ID for AlbumMediaCollection.