libaums icon indicating copy to clipboard operation
libaums copied to clipboard

storageprovider: "content could not be loaded right now"

Open SvenSv opened this issue 7 years ago • 9 comments

I'm using the storageprovider to read some mp3 files, and when I select the usb-drive, all folders and files are shown. As soon as I select the "music" folder, an hourglass appears (as a background image, not a busy-aniamtion) with the text "content could not be loaded right now" ("Inhalte können momentan nciht geladen werden." in my german version).

Any idea whats happening?

SvenSv avatar Aug 02 '17 09:08 SvenSv

Also, when theres an mp3 file in the root folder, it is displayed, but not selectable (or at least, nothing happens on press) , even though mp3 files from internal storage are selectable.

SvenSv avatar Aug 02 '17 11:08 SvenSv

Can you post a minimal example, which reproduces this error?

magnusja avatar Aug 02 '17 17:08 magnusja

Are you using the storageprovider and the normal API to the UsbMassStorageDevice at the same time? There are problems if two different processes are accessing the device simultaneously. Maybe try the storageprovider isolated and see if it works.

magnusja avatar Aug 03 '17 18:08 magnusja

sorry I didn't write earlier, I couldn't solve the problem and went another way.

SvenSv avatar Aug 08 '17 15:08 SvenSv

Can you maybe explain what exactly you did, so that other people know how to solve this problem?

magnusja avatar Aug 08 '17 15:08 magnusja

Well, I'm afraid I just didn't show the files in my app. Now I have to show them and I'm back at the same problem. By now I have

                    compile 'com.github.mjdev:libaums:0.5.5'
                    compile 'com.github.mjdev:libaums-storageprovider:0.5.1'
                    compile 'com.github.mjdev:libaums-httpserver:0.5.2'

in my gradle file and I just call the SAF with the usual

                    intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
                    int OPEN_REQUEST_CODE = 41;
                    intent.setType("*/*");
                    startActivityForResult(intent, OPEN_REQUEST_CODE);

SvenSv avatar Aug 15 '17 12:08 SvenSv

Hey there,

so using the storageprovider and the normal library/http module at the same time eads to problems. This is because the storageprovider and the normal library both access the USB device from different processes or threads. I do not know why this leads to problems, unfortunately, but try to only use one at the same time.

Why do you think you need the http and the storageprovider module at the same time?

magnusja avatar Aug 17 '17 05:08 magnusja

It would have been nice for convenience. I stopped using the storageprovider.

SvenSv avatar Aug 17 '17 08:08 SvenSv

So does that mean it works now?

magnusja avatar Aug 17 '17 22:08 magnusja