Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix opening file explorer apps #1066

Merged
merged 1 commit into from
Apr 27, 2018

Conversation

Catfriend1
Copy link
Contributor

@Catfriend1 Catfriend1 commented Apr 27, 2018

Purpose
Fix issue #838
Most file explorers do not implement the "resource/folder" mime type. If the user has such a file explorer installed, e.g. Root Explorer, OI file manager, a second try to find a file manager app that can handle opening the folder is attempted by using the chooserIntent. It will popup a menu like "choose which app you want to use to explore the folder".

Testing
Verified working with root explorer and OI file manager on Android 7.1.2 @lg-h815

verified working with root explorer and OI file manager
@Catfriend1 Catfriend1 self-assigned this Apr 27, 2018
@Catfriend1 Catfriend1 requested a review from Nutomic April 27, 2018 17:48
@Catfriend1 Catfriend1 changed the title fixes issue https://github.com/syncthing/syncthing-android/issues/838 fix opening file explorer apps Apr 27, 2018
@AudriusButkevicius
Copy link
Member

This doesn't explain why/how this fixes it.

@Catfriend1
Copy link
Contributor Author

@AudriusButkevicius I put a brief summary of the problem from the linked issue I intended to fix with this PR on top.

@AudriusButkevicius
Copy link
Member

You said that you've implemented a fallback mechanism, but I don't understand why using application/* mime type suddenly fixes this.

@Catfriend1
Copy link
Contributor Author

@AudriusButkevicius I checked using the debug build (https://build.syncthing.net/repository/download/SyncthingAndroid_Build/19963:id/debug/app-debug.apk). The code detects in resolveActivity that the result activitiy is null (no file manager app found installed that is compatible to folder/resource mime type). Before the change, the code showed a toast error and stopped. Now, it retries with the application/* mime type and the chooser Intent. That can be interpreted as an alternative way with a broader-matching filter. Now it finds a bunch of apps compatible to open (Root Explorer, QuickPic, OI, ...) and shows a selection UI to the user (this is done by ChooserIntent which is from android itself).

@AudriusButkevicius
Copy link
Member

I guess this doesn't make it any worse.

@AudriusButkevicius AudriusButkevicius merged commit f6f0951 into syncthing:master Apr 27, 2018
@Catfriend1 Catfriend1 deleted the fix-openfolder branch April 27, 2018 21:55
@syncthing syncthing locked and limited conversation to collaborators Apr 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants