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

Restore selected files when Activity restores after being killed #1536

Open
tunnela opened this issue Jan 10, 2023 · 1 comment
Open

Restore selected files when Activity restores after being killed #1536

tunnela opened this issue Jan 10, 2023 · 1 comment

Comments

@tunnela
Copy link

tunnela commented Jan 10, 2023

Feature Request

Motivation Behind Feature

Currently, if you select file(s) via the <input type="file"> element and the system decides to kill the Activity, the selected files will not be reachable when the Activity restores. The problem can be reproduced by enabling Android > Settings > Developer Options > Don't keep activities.

Feature Description

A new CordovaPlugin is needed, which correctly returns the selected files with Cordova's resume event. CordovaPlugin at:

SystemWebChromeClient.java#L231-L253

...needs to be replaced with this new CordovaPlugin.

Alternatives or Workarounds

I created a new Cordova plugin to solve this problem. See it here:

https://github.com/tunnela/cordova-plugin-pending-files

However, the implementation is not optimal, as I had to create a new class that extends the SystemWebChromeClient class of the cordova-android package and which is set as the new WebChromeClient when the my plugin is initialized. This may cause unexpected behavior. Therefore the new CordovaPlugin should be part of the cordova-android.

@tunnela
Copy link
Author

tunnela commented Jan 10, 2023

Does anyone have time to implement this feature based on my https://github.com/tunnela/cordova-plugin-pending-files plugin? I'm currently so overwhelmed with other projects that it would be great if someone else could do it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant