iPaulPro / aFileChooser

[DEPRECATED] Android library that provides a file explorer to let users select files on external storage.
Apache License 2.0
1.79k stars 850 forks source link

Whatsapp file sharing and local download file sharing bug fixed #96

Open nieldeokar opened 6 years ago

nieldeokar commented 6 years ago
  1. Fixed when you share file from whatsapp file path is inside "_display_name" column and not in default "_data".
  2. Fixed when you share file from local downloads you get NumberFormatException.

I was getting this errors on SDK 25,26.

nik910 commented 6 years ago

This does not work

nieldeokar commented 6 years ago

Hey, Thanks for testing. Can you please let me know which part is not working? whatsapp file sharing or local downloads file sharing ?

nik910 commented 6 years ago

@nieldeokar The whatsapp part is not working. The file.canRead method gives false and hence the path returned is null. Do we have to add any permissions in manifest for the above code to work?

nieldeokar commented 6 years ago

I will update you on this after testing it once again. Thanks!

nieldeokar commented 6 years ago

Actually in my app I am using FileUtils class for detecting incoming file Uri's from other apps. In which files coming from whatsapp were failing to resolve into their actual Uri. Anyone using FileUtils for same purpose would get benefited from it so I made the pull request.

But since FileChooserExample doesn't allow us to browse files from whatsapp it doesn't make any sense here. If you still want to test this feature you can add this intent-filter to FileChooserExampleActivity and check if you are able to resolve the Uri of whatsapp files.

<intent-filter>
                <action android:name="android.intent.action.SEND_MULTIPLE" />
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="image/*" />
 </intent-filter>
nik910 commented 6 years ago

@nieldeokar its already included but it still does not work