jaiselrahman / FilePicker

FilePicker library for Android
Apache License 2.0
238 stars 70 forks source link

ANR when opening FilePickerActivity with a large Data set #93

Open adfwhitestar opened 2 years ago

adfwhitestar commented 2 years ago

Describe the bug The App will ANR when calling FilePickerActivity and the OS has 100's of large files.

To Reproduce Steps to reproduce the behavior:

  1. Create an intent to FilePickerAcitivity
  2. pub extra intent.putExtra( FilePickerActivity.CONFIGS, Configurations.Builder() .setCheckPermission(true) .setShowImages(false) .setShowVideos(true) .enableImageCapture(false) .enableVideoCapture(true) .setMaxSelection(maxSelection) .setSkipZeroSizeFiles(true) .build() )
  3. Start Activity

Expected behavior The App shows a loading screen or something while waiting for the grid to appear

Actual Behavior The App will lock up and Show the ANR dialog. if the user clicks "wait" it will attempt to finish the process. (on my device it took about 20 seconds yes there are alot of files on this device) the App will crash if the user does nothing.

Android info (please complete the following information):

Additional context This is used in a Video Selection application and the UI locks up and ANRs when calling the file picker. This does not happen on a device with only 10s of files. you need a device that has 100s if not 1000s of files ( even if this is not reproducible this should not be doing any File IO or Parsing on the main thread )

vinayakmestri commented 2 years ago

I am facing same problem

sazibislam commented 1 year ago

Any solution so far?